import torch


def threshold(data:torch.Tensor, min_value:torch.Tensor, max_value:torch.Tensor) -> torch.Tensor:
    """
    Generate mask using min & max values.

    Note, data in (max_value, min_value) interval have True values.

    Parameters
    ----------
    data: torch.Tensor
        input 1D data
    min_value: float
        min value threshold
    max_value: float
        max value threshold

    Returns
    -------
    mask (torch.Tensor)

    """
    return (data > min_value.reshape(-1, 1))*(data < max_value.reshape(-1, 1))