InferenceTensorTile<TLogic extends Logic, TValue> constructor
- required int rowCount,
- required int columnCount,
- required TypedLogicArrayElementBuilder<
TLogic> elementBuilder, - required InferenceNumericFormat format,
- LogicValueCodec<
TValue> ? valueCodec, - TypedLogicArrayElementCompatibility<
TLogic> ? elementCompatibility, - String name = 'inferenceTensorTile',
- int numUnpackedDimensions = 0,
Creates a typed tensor tile.
Implementation
factory InferenceTensorTile({
required int rowCount,
required int columnCount,
required TypedLogicArrayElementBuilder<TLogic> elementBuilder,
required InferenceNumericFormat format,
LogicValueCodec<TValue>? valueCodec,
TypedLogicArrayElementCompatibility<TLogic>? elementCompatibility,
String name = 'inferenceTensorTile',
int numUnpackedDimensions = 0,
}) {
if (rowCount < 1 || columnCount < 1) {
throw ArgumentError('Tensor tile dimensions must be positive.');
}
final data = TypedLogicArray<TLogic, TValue>(
[rowCount, columnCount],
elementBuilder,
valueCodec: valueCodec,
elementCompatibility: elementCompatibility,
name: 'data',
numUnpackedDimensions: numUnpackedDimensions,
);
if (data.elementWidth != format.elementWidth) {
throw ArgumentError(
'Tensor element width ${data.elementWidth} does not match numeric '
'format width ${format.elementWidth}.',
);
}
return InferenceTensorTile<TLogic, TValue>.fromData(
data: data,
format: format,
name: name,
);
}