Tensor constructor
Tensor(
- Float32List data,
- List<
int> shape
Creates a tensor from existing data and shape.
The data length must equal the product of shape dimensions.
Implementation
Tensor(this.data, this.shape) {
assert(_productOfShape(shape) == data.length,
'Data length ${data.length} != shape product ${_productOfShape(shape)}');
strides = _computeStrides(shape);
}