Contents

rank

The number of dimensions of the tensor.

Declaration

var rank: Int { get }

Discussion

Rank is equal to the number of dimensions of the shape, i.e., tensor.rank == tensor.shape.count.

See Also

Accessing tensor properties