Shortcuts

torch.Tensor.sparse_resize_and_clear_

Tensor.sparse_resize_and_clear_(size, sparse_dim, dense_dim) Tensor

Removes all specified elements from a sparse tensor self and resizes self to the desired size and the number of sparse and dense dimensions.

Parameters:
  • size (torch.Size) – the desired size.

  • sparse_dim (int) – the number of sparse dimensions

  • dense_dim (int) – the number of dense dimensions

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources