lloca.utils.compile
Helpers for using lloca networks with torch.compile().
Functions
|
Wrap |
- lloca.utils.compile.compile_model(model, *, compile_kwargs=None)[source]
Wrap
model.forwardwithtorch.compile()in place.Rebinding
self.forwardrather than patching the class keeps the compilation local to this instance.- Parameters:
model (
Module) – Thetorch.nn.Modulewhoseforwardshould be compiled.compile_kwargs (
Mapping|None) – Forwarded verbatim totorch.compile()(e.g.mode,dynamic,fullgraph,backend). Any key omitted falls back to torch’s own default.
- Return type:
None