TensorShape class
Shape of a tensor. Currently the limit is 4 dimensions.
Example
import 'package:calc/calc.dart';
void main() {
final shape = TensorShape([1,2,3]);
}
Constructors
- TensorShape(int x, [int y = 0, int z = 0, int w = 0])
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- numberOfDimensions → int
-
Number of dimensions.
no setter
- numberOfElements → int
-
Returns the number of elements in the tensor.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- w → int
-
final
- x → int
-
final
- y → int
-
final
- z → int
-
final
Methods
-
flatten(
int x, [int y = -1, int z = -1, int w = -1]) → int - Flattens (x, y, z, w) into a list index.
-
getW(
int i) → int -
Gets
w
dimension of a flat index (see flatten). -
getX(
int i) → int -
Gets
x
dimension of a flat index (see flatten). -
getY(
int i) → int -
Gets
y
dimension of a flat index (see flatten). -
getZ(
int i) → int -
Gets
z
dimension of a flat index (see flatten). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- scalar → const TensorShape