MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / is_compiled_module

Function is_compiled_module

src/diffusers/utils/torch_utils.py:85–89  ·  view source on GitHub ↗

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

(module)

Source from the content-addressed store, hash-verified

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

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