half

package
v0.9.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package half converts the 16-bit floating-point storage encodings used by model files — IEEE 754 half-precision (binary16) and bfloat16 — to float32. Born has no native half-precision dtype, so format readers widen on load.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BFloat16ToFloat32 added in v0.9.19

func BFloat16ToFloat32(b uint16) float32

BFloat16ToFloat32 converts a bfloat16 value to float32. bfloat16 is the top 16 bits of the IEEE 754 float32 representation, so widening is a left shift.

func Float16ToFloat32

func Float16ToFloat32(h uint16) float32

Float16ToFloat32 converts an IEEE 754 half-precision (binary16) value to float32, handling subnormals, infinities, and NaNs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL