Solved by KFrank in post #2 
              
              
                Hi Niko! 

Your pytorch code raises, in effect, f (angle) to a power, while your 
numpy code raises np.abs (f (angle)) to a power.  When f (angle) 
is negative and power is fractional, your pytorch code will return nan. 
(As an aside, pytorch also supports the “**” syntax for exponentiation.) 
Consi…