def Half.unpack

bendtorch@1.3.0.0 · dtype.bend:242

import bendtorch@1.3.0.0/dtype.bend as Dtype
import Base
import bend-ml-tensor-array@0.1.18.0/main.bend as TA

242# a packed matrix decoded by g (BF16.to_f32 or F16.to_f32) into F32
243def Half.unpack(~g: @+h: U32 -> F32, +r: Nat, +c: Nat, h: HMat<r, c>) -> TA.Mat<r, c>:
244  match h:
245    case HMat{d}:
246      TA.Mat.from_list(r, c, dec_l(~g, Half.values(Nat.mul(r, c), d)))

Uses (9)

Used by (2)