Tensor2D constructor
Tensor2D(
- int rows,
- int cols, {
- Float64List? data,
Implementation
Tensor2D(this.rows, this.cols, {Float64List? data})
: data = data ?? Float64List(rows * cols) {
assert(rows > 0 && cols > 0, 'rows and cols must be positive');
assert(this.data.length == rows * cols,
'data length must equal rows*cols');
}