def label2class(y, class_names):
    """Converts label indices to class names.
    
    Parameters
    ----------
    y: Tensor, Variable, or numpy array
    class_names: list
    
    Returns
    -------
    List containing the class name for each prediction.
    """
    return list(map(lambda x: class_names[x], y))