Solved by Abhilash_Srivastava in post #2 
              
              
                The error Message Bool value of Tensor with more than one value is ambiguous  appears when you try to cast a tensor into a bool value. This happens most commonly when passing the tensor to an if  condition. 
A better way of doing this could be to use torch.argmax instead.