Tensor2D constructor

Tensor2D(
  1. int rows,
  2. int cols, {
  3. 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');
}