TensorData class final

Tensor data for input/output.

Represents a multi-dimensional array of numeric data used as input to or output from model inference.

Example:

final input = TensorData(
  shape: [1, 3, 224, 224],  // NCHW format
  dataType: TensorType.float32,
  data: imageBytes,
  name: 'input_0',
);

Constructors

TensorData({required List<int?> shape, required TensorType dataType, required Uint8List data, String? name})
Creates a new TensorData instance.

Properties

data Uint8List
The raw bytes of tensor data.
final
dataType TensorType
The data type of tensor elements.
final
hashCode int
The hash code for this object.
no setteroverride
name String?
Optional name for the tensor.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape List<int?>
The dimensions of the tensor.
final

Methods

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

Operators

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