Rate this Page

torch.Tensor.sparse_resize_and_clear_#

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

Removes all specified elements from asparse tensorself and resizesself to the desiredsize 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