Check whether the module was compiled with torch.compile()
(module)
| 84 | |
| 85 | |
| 86 | def is_compiled_module(module) -> bool: |
| 87 | """Check whether the module was compiled with torch.compile()""" |
| 88 | if is_torch_version("<", "2.0.0") or not hasattr(torch, "_dynamo"): |
| 89 | return False |
| 90 | return isinstance(module, torch._dynamo.eval_frame.OptimizedModule) |
| 91 | |
| 92 | |
| 93 | def fourier_filter(x_in: "torch.Tensor", threshold: int, scale: int) -> "torch.Tensor": |