[ 仅 API 调用方式不一致 ]torch.Tensor.to_sparse
torch.Tensor.to_sparse
torch.Tensor.to_sparse(sparse_dim)
转写示例
# PyTorch 写法
b = a.to_sparse(1)
# Paddle 写法
b = a.to_sparse_coo(1)

torch.Tensor.to_sparse(sparse_dim)
# PyTorch 写法
b = a.to_sparse(1)
# Paddle 写法
b = a.to_sparse_coo(1)