Go · Scalar Types

Scalar Types

import "github.com/ashvardanian/NumKong" 8.0.0-rc.1 · b1f866ab

API

Functions

DimensionsPerValueDimensionsPerValue returns how many logical dimensions of dtype share one stored value, such as 8 for "u1".
numkong.go:31 ↗
func DimensionsPerValue(dtype string) int

It panics on any name other than "f64", "f32", "i8", "u8" and "u1".

DimensionsToValuesDimensionsToValues returns how many stored values hold dimensions logical dimensions of dtype.
numkong.go:37 ↗
func DimensionsToValues(dtype string, dimensions int) int

The dimensions must be a multiple of DimensionsPerValue for dtype.