MCPcopy Index your code
hub / github.com/huggingface/diffusers / is_compiled_module

Function is_compiled_module

src/diffusers/utils/torch_utils.py:202–206  ·  view source on GitHub ↗

Check whether the module was compiled with torch.compile()

(module)

Source from the content-addressed store, hash-verified

200
201
202def 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
209def unwrap_module(module):

Callers 15

unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90
unwrap_modelFunction · 0.90

Calls 1

is_torch_versionFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…