TensorShape class Null safety

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. [...]
read-only, override
numberOfDimensions int
Number of dimensions.
read-only
numberOfElements int
Returns the number of elements in the tensor.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
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 non-existent 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