Check whether the module was compiled with torch.compile()
(module)
| 78 | |
| 79 | |
| 80 | def is_compiled_module(module): |
| 81 | """Check whether the module was compiled with torch.compile()""" |
| 82 | if is_torch_version("<", "2.0.0") or not hasattr(torch, "_dynamo"): |
| 83 | return False |
| 84 | return isinstance(module, torch._dynamo.eval_frame.OptimizedModule) |
no test coverage detected