(tensor, mask)
return torch.mul(tensor, mask.type(tensor.type()))
Computes masked version of tensor.

    :param tensor: PyTorch tensor
    :type tensor: `torch.Tensor`
    :param mask: Binary mask
    :type mask: `torch.Tensor`
    :return: Masked version of `tensor`
    :rtype: `torch.Tensor`
Computes masked version of tensor.
Computes masked version of tensor .
def apply_mask(tensor, mask):
    """
    Computes masked version of tensor.

    :param tensor: PyTorch tensor
    :type tensor: `torch.Tensor`
    :param mask: Binary mask
    :type mask: `torch.Tensor`
    :return: Masked version of `tensor`
    :rtype: `torch.Tensor`
    """
    #assert isinstance(tensor, torch.Tensor)
    return torch.mul(tensor, mask.type(tensor.type()))
def apply_mask ( tensor , mask ) : #assert isinstance(tensor, torch.Tensor) return torch . mul ( tensor , mask . type ( tensor . type ( ) ) )