Tensor<T> class
abstract
Superclass for tensors where elements may be integers, real numbers, or complex numbers.
Implementations
32-bit floating points
- Implementers
Constructors
- Tensor()
Properties
-
elements
→ List<
T> -
Returns elements as a list.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isScalar → bool
-
Tells whether the tensor is a scalar.
no setter
- isZero → bool
-
Tells whether all elements are zero.
no setter
- length → int
-
Returns number of elements in the tensor.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tensorShape → TensorShape
-
Returns shape of the tensor.
no setter
Methods
-
ceil(
) → Tensor< T> -
Calculates
x.ceil()
for each element. -
clamp(
T lowerLimit, T upperLimit) → Tensor< T> -
Calculates
x.clamp(lowerLimit, upperLimit)
for each element. -
cos(
) → Tensor< T> -
Calculates
cos(x)
for each element. -
div(
Tensor< T> right, {bool noNan = false}) → Tensor<T> - Calculates element-wise fraction.
-
divScalar(
num right, {bool noNan = false, bool swapArguments = false}) → Tensor< T> - Calculates element-wise fraction.
-
exp(
) → Tensor< T> -
Calculates
exp(x)
for each element. -
floor(
) → Tensor< T> -
Calculates
x.floor()
for each element. -
getFlat(
int index) → T -
log(
) → Tensor< T> -
Calculates
log(x)
for each element. -
max(
Tensor< T> right) → Tensor<T> - Calculates element-wise maximum.
-
min(
Tensor< T> right) → Tensor<T> - Calculates element-wise minimum.
-
mulScalar(
num s) → Tensor - Multiplies tensor elements with a scalar.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pow(
Tensor< T> right) → Tensor<T> - Calculates element-wise power.
-
scale(
num s) → Tensor -
scaleInverse(
num s) → Tensor -
sin(
) → Tensor< T> -
Calculates
sin(x)
for each element. -
sq(
) → Tensor< T> -
Calculates
x * x
(square) for each element. -
sqrt(
) → Tensor< T> -
Calculates
sqrt(x)
(square root) for each element. -
tan(
) → Tensor< T> -
Calculates
tan(x)
for each element. -
toBuilder(
{bool copy = true}) → TensorBuilder< T> - Constructs a TensorBuilder that has this tensor.
-
toScalar(
) → T - Returns a scalar when the tensor has only a single element;
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator *(
Tensor< T> right) → Tensor<T> - Calculates element-wise product.
-
operator +(
Tensor< T> right) → Tensor<T> - Calculates element-wise sum.
-
operator -(
Tensor< T> right) → Tensor<T> - Calculates element-wise difference.
-
operator /(
Tensor< T> right) → Tensor<T> - A shorthand for div.
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator unary-(
) → Tensor< T> -
Calculates
scale(-1.0)
.