import torch


def one_hot(class_n, x):
    """
    Make scalar into one-hot vector
    :param class_n: number of classes
    :param x: the scalar
    :return: converted one-hot vector
    """
    return torch.eye(class_n)[x]