Solved by albanD in post #2 
              
              
                Hi, 
You should be using torch implementation of any function you use. 
All pytorch function will work. Or raise an error if you’re asking for things that are not supported/non-differentiable.