AttributeError: 'NoneType' object has no attribute '__module__'

Hi,

I am following the second example of the official tutorial on the link: torch.jit.trace.html.
However, I get the error:

AttributeError: 'NoneType' object has no attribute '__module__'

for the line:

torch.jit.trace()

tested torch versions: 1.12.1+cu116, 1.13.0+cu116 and 1.13.0+cu117
fastai: 2.7.10

Any suggestions on how to solve this issue?

I cannot reproduce the issue using torch==1.13.0 and both example code snippet work without raising an error.