Tensor class

Constructors

Tensor(List<int> shape, {Iterable<Tensor>? children})
Tensor.fill(List<int> shape, double val)
factory
Tensor.ones(List<int> shape, {Set<Tensor>? children})
Creates a new Tensor filled with 1.0
factory
Tensor.random(List<int> shape)
factory
Tensor.zeros(List<int> shape, {Set<Tensor>? children})
Creates a new Tensor filled with 0.0
factory

Properties

data Float32List
getter/setter pair
grad Float32List
final
hashCode int
The hash code for this object.
no setterinherited
length int
final
onBackward ← void Function()
no getter
parents Set<Tensor>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape List<int>
final

Methods

abs() Tensor
backward({bool seed = true}) → void
crossEntropy(Tensor target) Tensor
exp() Tensor
gelu() Tensor
getRow(int rowIndex) Tensor
Extracts a specific row as a new 1, Cols Tensor
leakyRelu([double alpha = 0.01]) Tensor
matmul(Tensor other) Tensor
mseLoss(Tensor target) Tensor
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pow(num exponent) Tensor
relu() Tensor
setRow(int rowIndex, Tensor rowTensor) → void
In-place copy of row data (Used for assembling the final Y matrix)
sigmoid() Tensor
slice(int startOffset, int endOffset) Tensor
slice2D(int rows, int cols) Tensor
softmax() Tensor
sqrt() Tensor
toString() String
A string representation of this object.
inherited
transpose() Tensor
zeroGrad() → void

Operators

operator *(dynamic other) Tensor
operator +(dynamic other) Tensor
operator -(dynamic other) Tensor
operator /(dynamic other) Tensor
operator ==(Object other) bool
The equality operator.
inherited
operator unary-() Tensor

Static Methods

concat(List<Tensor> tensors, {int axis = 1}) Tensor
xavier(List<int> shape) Tensor