Hi,
If you just want to set the values to 0 when the mask is 0 then the mask and your tensor should be of the same type and just multiply the two.
If you want to extract as a new tensor all the entries of your tensor where the mask value is 1, the the mask should be a ByteTensor and you can use masked_select or []: tensor[mask] or tensor.masked_select(mask).