import torch


def jury_func(predictions: torch.Tensor, *_) -> torch.Tensor:
    """
    Remove the highest and lowest predictions outputs of classifiers and
    take a mean of the remaining ones.

    Args:
        predictions: outputs of the base models
        *_:

    Returns:
        a prediction tensor
    """
    inputs = torch.sort(predictions.T, dim=1).values
    inputs = inputs[:, 1:-1].T
    return torch.sum(inputs, dim=0)