評價此頁

torch.Tensor.sparse_resize_and_clear_#

Tensor.sparse_resize_and_clear_(size, sparse_dim, dense_dim) Tensor#

稀疏張量 self 中移除所有指定的元素,並將 self 調整到所需的大小以及稀疏和密集維度的數量。

引數
  • size (torch.Size) – 所需的大小。

  • sparse_dim (int) – 稀疏維度的數量

  • dense_dim (int) – 密集維度的數量