half

package
v0.9.21 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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