Docs / nablatensor-tensor / com.nablatensor.tensor

record

Shape

An immutable tensor shape.

Record components

dims
int[]

Methods

static Shape of(int... dims)
int rank()
int dim(int axis)
long size()
Shape reshape(int... requestedDims)

Returns a shape with the same element count. One dimension may be -1 and is inferred from the remaining dimensions.

Shape transposed()

2-D transpose; only defined for rank-2 shapes.

static Shape broadcast(Shape a, Shape b)

NumPy-style broadcast result shape: shapes are right-aligned, missing leading dims count as 1, and each aligned pair must be equal or one of them must be 1.

int[] dims()
boolean equals(Object o)
int hashCode()
String toString()