Are you running into the same issue regarding an unsupported GeneratorExp?
If so, then it’s still not supported in the scripting mode and you would have to guard this line of code with the mentioned if not torch.jit.is_scripting() code.
Let me know, which example you are looking for.