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.
The number of dimensions of the tensor.
var rank: Int { get }Rank is equal to the number of dimensions of the shape, i.e., tensor.rank == tensor.shape.count.