Solved by SimonW in post #2 
              
              
                torch.abs(test_output - test_secrete). PyTorch and NumPy are different packages. Apart from conversion methods (and probably implicit conversions), you shouldn’t expect methods of one package to work on another.