import torch


def getMaskFromTensor(tensor: torch.Tensor):
    """
        This functions extracts the mask from the unthresholded output of a NN
        Args:
            tensor (Tensor): Tensor image of size (1, H, W)
        Returns:
            Tensor: UnNormalized image.
    """
    # Find sigmoid probability and apply a probability Threshold

    # tensor = F.relu(tensor)
    tensor = torch.sigmoid(tensor)

    return tensor