The solution is here from mhubi (builds but I haven’t tested it):
The key here is inclusion of TORCH_MODULE(Net). See example.