Tensor2D class

Constructors

Tensor2D(int rows, int cols, {Float64List? data})
Tensor2D.fromFlat(int rows, int cols, List<double> flat)
factory
Tensor2D.fromNestedList(List<List<double>> x)
factory
Tensor2D.zeros(int rows, int cols)
factory

Properties

cols int
final
data Float64List
final
hashCode int
The hash code for this object.
no setterinherited
rows int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addInPlace(Tensor2D other) → void
In-place add another tensor with the same shape.
clone() Tensor2D
getAt(int i, int j) double
Safe element accessors (bounds-checked by assert in debug)
multiplyBatch(List<List<double>> vecs) List<List<double>>
Multiply a batch of vectors: vecs.length = batchSize, each vec length = rows Returns a list of length batchSize, each sublist length = cols.
multiplyVector(List<double> vec) List<double>
Fast vector * matrix multiply: vec (length = rows) * this (rows x cols) Returns a new List
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pretty({int maxRows = 6, int maxCols = 6}) String
Returns a pretty string of the tensor's contents (for debugging)
randomNormal(double std, {int seed = 42}) → void
Fills with N(0, std^2)
row(int i) Float64List
Returns a copy of row i as Float64List
setAt(int i, int j, double v) → void
toString() String
A string representation of this object.
override

Operators

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