import torch


def hot_to_indices(hot):
    """Convert an element of one-hot encoding to indices
    """
    hot = torch.tensor(hot)
    _,max_index=hot.max(1)
    return max_index.data.cpu().numpy().tolist()