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