import torch


def to_one_hot_encode(target, classes):
    """Convert target values to one-hot encoded vector
    :param target: The expected output or our labels
    :type target: typing.Union[torch.Tensor]
    :param classes: Number of classes
    :type classes: int
    :return: one hot encoded vectors of target
    :rtype: torch.Tensor"""

    one_hot = torch.zeros(target.shape[0], classes)
    target = target.long()
    for i in range(one_hot.shape[0]):
        one_hot[i, target[i]] = 1
    return one_hot