import torch
import typing


def categorical(
    output: torch.Tensor, target: torch.Tensor
) -> typing.Tuple[torch.Tensor, torch.Tensor]:
    """
    Transform output and target to categorical.

    Additionally, `target` will be transformed to `long` for faster comparison
    (as it is already a categorical).

    Arguments:
        output :
            Usually neural network output
        target :
            Usually desired target

    Returns:
        typing.Tuple[torch.Tensor, torch.Tensor]:
            Categorical `output` and `target`.

    """
    return torch.argmax(output, dim=1).long(), target.long()