MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / compiled_function

Method compiled_function

k_diffusion/models/flags.py:43–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41
42 @property
43 def compiled_function(self):
44 if self._compiled_function is not None:
45 return self._compiled_function
46 if get_use_compile():
47 try:
48 self._compiled_function = torch.compile(self.function, *self.args, **self.kwargs)
49 except RuntimeError:
50 self._compiled_function = self.function
51 else:
52 self._compiled_function = self.function
53 return self._compiled_function
54
55 def __call__(self, *args, **kwargs):
56 return self.compiled_function(*args, **kwargs)

Callers 1

__call__Method · 0.95

Calls 1

get_use_compileFunction · 0.85

Tested by

no test coverage detected