Check whether the module was compiled with torch.compile()
(module)
| 200 | |
| 201 | |
| 202 | def is_compiled_module(module) -> bool: |
| 203 | """Check whether the module was compiled with torch.compile()""" |
| 204 | if is_torch_version("<", "2.0.0") or not hasattr(torch, "_dynamo"): |
| 205 | return False |
| 206 | return isinstance(module, torch._dynamo.eval_frame.OptimizedModule) |
| 207 | |
| 208 | |
| 209 | def unwrap_module(module): |
searching dependent graphs…