| 628 | }; |
| 629 | |
| 630 | nb::object call_impl(const nb::args& args, const nb::kwargs& kwargs) { |
| 631 | auto output_structure = std::make_shared<nb::object>(); |
| 632 | auto full_args = nb::make_tuple(args, kwargs); |
| 633 | auto [inputs, args_structure] = |
| 634 | tree_flatten_with_structure(full_args, false); |
| 635 | |
| 636 | auto outputs = mx::checkpoint( |
| 637 | InnerFunction(fun_, args_structure, output_structure))(inputs); |
| 638 | |
| 639 | return tree_unflatten_from_structure(*output_structure, outputs); |
| 640 | } |
| 641 | |
| 642 | nb::object operator()(const nb::args& args, const nb::kwargs& kwargs) const { |
| 643 | return const_cast<PyCheckpointedFun*>(this)->call_impl(args, kwargs); |
nothing calls this directly
no test coverage detected