Skip to main content

From values

sf.array quantizes a list, a nested list or a NumPy array. The dtype is required unless the input already holds Superfloat values.
sf.asarray returns the input itself when it is already an SFArray of the right dtype and placement; sf.array always copies. Quantization goes through the error policy with counts, so one element at 1.0 in a thousand is reported as overflow in 1 of 1000 element(s).

Filled arrays

sf.ones exists for API symmetry but 1 does not fit in any width, so it follows the literal rule and raises unless overflow is ignored, in which case it saturates.

From codes

When you have the integers the chip holds, skip quantization:
Codes are validated against the width; an out-of-range code raises SFTypeError.

On a device

Pass device= to place the array on a target. Only sf16 is accepted on Atreides.
The device path →

Attributes and methods

Arrays are immutable like scalars: no in-place assignment.