You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the unrealistic example, but the same also happens when feeding appropriate tensors to the model.
The error:
Traceback (most recent call last):
File ".../program.py", line 28, in <module>
torch.jit.save(model, "model.pt")
File ".../lib/python3.12/site-packages/torch/jit/_serialization.py", line 84, in save
m.save(f, _extra_files=_extra_files)
File ".../lib/python3.12/site-packages/torch/jit/_script.py", line 754, in save
return self._c.save(str(f), **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError:
Could not export Python function call '_CustomExp1'. Remove calls to Python functions before export. Did you forget to add @script or @script_method annotation? If this is a nn.ModuleList, add it to __constants__:
File ".../lib/python3.12/site-packages/torchpme/lib/math.py", line 76
:return: Exponential integral E1(x)
"""
return _CustomExp1.apply(x)
~~~~~~~~~~~~~~~~~ <--- HERE
The text was updated successfully, but these errors were encountered:
Good catch, @frostedoyster, thank you very much! After a bit of research, I found that, unfortunately, torch.script does not support custom autograd functions. We need to figure out how to replace it in this case.
For example, this fails:
Sorry for the unrealistic example, but the same also happens when feeding appropriate tensors to the model.
The error:
The text was updated successfully, but these errors were encountered: