评价此页

torch.Tensor.sparse_dim#

Tensor.sparse_dim() int#

返回张量 self 的稀疏维度数量。

注意

如果 self 不是稀疏张量,则返回 0

另请参阅 Tensor.dense_dim()混合张量