Skip to content

Commit

Permalink
Forward script fallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Salzmann committed Jan 11, 2024
1 parent 1f85dcd commit ac4f800
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion l4casadi/l4casadi.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ def export_torch_traces(self, rows: int, cols: int) -> Tuple[bool, bool]:

out_folder = self.build_dir

torch.jit.trace(self.model, d_inp).save((out_folder / f'{self.name}_forward.pt').as_posix())
self._jit_compile_and_save(make_fx(functionalize(self.model, remove='mutations_and_views'))(d_inp),
(out_folder / f'{self.name}_forward.pt').as_posix(),
d_inp)

exported_jacrev = False
if self._with_jacobian:
Expand Down

0 comments on commit ac4f800

Please sign in to comment.