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