torch.Tensor.sparse_dim¶ Tensor.sparse_dim() → int¶ 傳回稀疏張量 self中的稀疏維度數量。 注意 如果 self 不是稀疏張量,則傳回 0。 另請參閱 Tensor.dense_dim() 和 混合張量。