Hello. I’m trying to set ignore_index for labels during training with CE loss, my code seemed as follows,
    for i, data in enumerate(train_loader):
        labels[labels > 0.9] = 1
        labels[labels < 0.1] = 0

        # bug occurred here
        labels[0.1<=labels<=0.9] = -1

        loss = nn.CrossEntropyLoss(out, labels, ignore_index=-1)

I got RuntimeError: Boolean value of Tensor with more than one value is ambiguous
during training.
What’s wrong here? Thanks.