InferenceNumericFormat class

Immutable numeric policy for inference tensor elements.

This descriptor creates no hardware. It keeps storage, product, accumulation, scale, rounding, and overflow choices explicit when composing inference components.

Annotations

Constructors

InferenceNumericFormat({required InferenceElementKind elementKind, required int elementWidth, required int productWidth, required int accumulatorWidth, required bool signed, InferenceScaleKind scaleKind = InferenceScaleKind.none, int scaleWidth = 0, int groupSize = 1, int? integerWidth, int? fractionWidth, int? exponentWidth, int? mantissaWidth, NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven, NumericOverflowMode overflowMode = NumericOverflowMode.saturate})
Creates a validated numeric format.
InferenceNumericFormat.blockScaled({required int elementWidth, required bool signed, required InferenceScaleKind scaleKind, required int scaleWidth, required int groupSize, int? productWidth, int? accumulatorWidth, NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven, NumericOverflowMode overflowMode = NumericOverflowMode.saturate})
Creates a block-scaled low-precision inference format.
factory
InferenceNumericFormat.fixedPoint({required bool signed, required int integerWidth, required int fractionWidth, int? productWidth, int? accumulatorWidth, NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven, NumericOverflowMode overflowMode = NumericOverflowMode.saturate})
Creates a fixed-point inference format.
factory
InferenceNumericFormat.floatingPoint({required int exponentWidth, required int mantissaWidth, int? productWidth, int? accumulatorWidth, NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven, NumericOverflowMode overflowMode = NumericOverflowMode.saturate})
Creates a floating-point inference format.
factory
InferenceNumericFormat.signedInteger(int width, {int? productWidth, int? accumulatorWidth, NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven, NumericOverflowMode overflowMode = NumericOverflowMode.saturate})
Creates a signed integer inference format.
factory
InferenceNumericFormat.unsignedInteger(int width, {int? productWidth, int? accumulatorWidth, NumericRoundingMode roundingMode = NumericRoundingMode.nearestEven, NumericOverflowMode overflowMode = NumericOverflowMode.saturate})
Creates an unsigned integer inference format.
factory

Properties

accumulatorWidth → int
Number of bits retained by an accumulation.
final
configurationSignature → String
Stable identity suitable for generated definition names.
no setter
elementKind → InferenceElementKind
Physical element interpretation.
final
elementWidth → int
Number of stored bits per tensor element.
final
exponentWidth → int?
Floating-point exponent width.
final
fractionWidth → int?
Fixed-point fraction width.
final
groupSize → int
Number of tensor elements sharing one scale.
final
hashCode → int
The hash code for this object.
no setteroverride
integerWidth → int?
Fixed-point integer width, excluding the sign bit.
final
mantissaWidth → int?
Floating-point mantissa width.
final
overflowMode → NumericOverflowMode
Overflow policy applied when narrowing.
final
productWidth → int
Number of bits produced by one element multiplication.
final
roundingMode → NumericRoundingMode
Rounding policy applied when narrowing.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scaleKind → InferenceScaleKind
Representation of separate scale metadata.
final
scaleWidth → int
Number of bits in one separate scale.
final
signed → bool
Whether fixed-point or block-scaled element bits are signed.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override