dgs.utils.utils.ids_to_one_hot

dgs.utils.utils.ids_to_one_hot(ids: torch.Tensor | torch.Tensor, nof_classes: int) torch.Tensor[source]

Given a tensor containing the class ids as LongTensor, return the one hot representation as LongTensor.