torch.Tensor.sparse_mask
Tensor.sparse_mask(mask) -> Tensor
Returns a new sparse tensor with values from a strided tensor
   "self" filtered by the indices of the sparse tensor "mask". The
   values of "mask" sparse tensor are ignored. "self" and "mask"
   tensors must have the same shape.
Note:
 The returned sparse tensor might contain duplicate values if
 "mask" is not coalesced. It is therefore advisable to pass
 "mask.coalesce()" if such behavior is not desired.

Note:
 The returned sparse tensor has the same indices as the sparse
 tensor "mask", even when the corresponding values in "self" are
 zeros.

Parameters:
      mask (Tensor) -- a sparse tensor whose indices are used as
      a filter
Example:
  >>> nse = 5
  >>> dims = (5, 5, 2, 2)
  >>> I = torch.cat([torch.randint(0, dims[0], size=(nse,)),
  ...                torch.randint(0, dims[1], size=(nse,))], 0).reshape(2, nse)
