Check if this shape represents a matrix (2 dimensions)
Check if this shape represents a scalar (0 dimensions)
Check if this shape represents a vector (1 dimension)
Number of dimensions (rank) of the tensor
Total number of elements in the tensor
Strides for each dimension (row-major order) Used for efficient memory access calculations
Check if this shape is compatible with another shape for broadcasting
Check if this shape is compatible with another shape for matrix multiplication
Check if this shape can be reshaped to another shape
Get default strides for this shape (row-major)
Get a dimension size by index, with support for negative indexing
Compute the result shape of matrix multiplication with another shape
Convert multi-dimensional indices to linear index
Create a new shape with dimensions squeezed (size-1 dimensions removed)
Optional
axes: number[]String representation for debugging
Convert linear index to multi-dimensional indices
Create a new shape with a size-1 dimension added at the specified axis
Static
broadcastStatic
canStatic
canCheck if two shapes can be matrix multiplied
Matrix multiplication is valid when:
true if shapes can be matrix multiplied
Static
equalsStatic
fromCreate a RuntimeShape from array-like input
Static
inferStatic
matmulStatic
padInternal
Pad a shape with 1s on the left to reach target length
Static
productStatic
validateValidate that a shape is well-formed
Runtime representation of a tensor shape with computed properties Provides efficient access to shape metadata and validation