InferenceNumericFormat.blockScaled constructor
- 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.
Implementation
factory 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,
}) {
final resolvedProductWidth = productWidth ?? elementWidth * 2;
return InferenceNumericFormat(
elementKind: InferenceElementKind.blockScaled,
elementWidth: elementWidth,
productWidth: resolvedProductWidth,
accumulatorWidth: accumulatorWidth ?? resolvedProductWidth,
signed: signed,
scaleKind: scaleKind,
scaleWidth: scaleWidth,
groupSize: groupSize,
roundingMode: roundingMode,
overflowMode: overflowMode,
);
}