Got RuntimeError: Boolean value of Tensor with more than one value is ambiguous during training

You have to combine the two conditions via &:

labels[(0.1<=labels) & (labels<=0.9)]