def BF16.to_f32

bendtorch@1.3.0.0 · dtype.bend:54

import bendtorch@1.3.0.0/dtype.bend as Dtype
import Base

54# BF16 -> F32 is exact: the 16 bits become the top half
55def BF16.to_f32(+h: U32) -> F32:
56  u2f(U32.shln((h .&. 65535 : U32), 16n))

Uses (5)

Used by (2)