(self)
| 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) |
no test coverage detected