RuntimeError: bool value of Variable objects containing non-empty torch.LongTensor is ambiguous

I found some related posts: