Solved by driazati in post #3 
              
              
                Also just FYI @torch.jit.ignore functions cannot be exported, if you do scripted_module.save("out.pt") you’ll get 
Traceback (most recent call last):
  File "../test.py", line 196, in <module>
    scripted_module.save('s.pt')
  File "/home/pytorch/torch/jit/__init__.py", line 1621, in save
    retur…