Rate this Page

torch.Tensor.sparse_dim#

Tensor.sparse_dim()int#

Return the number of sparse dimensions in asparse tensorself.

Note

Returns0 ifself is not a sparse tensor.

See alsoTensor.dense_dim() andhybrid tensors.