Hi,
I have a model that I want to compile, but I need to disable compilation for some functions inside the class. I use @torch.compiler.disable() to disable compilation for these functions, and an argparse parameter to decide whether to attempt compilation.
The issue arises when using an older version of PyTorch that does not support torch.compile. I get an error because torch.compile does not exist in those versions. How can I use this decorator while maintaining backward compatibility? Note that the user should not use the compile parameter with the old PyTorch version, but the decorator still causes an issue.
Thanks