MCPcopy Index your code
hub / github.com/ml-explore/mlx / call_impl

Method call_impl

python/src/transforms.cpp:630–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 4

InnerFunctionClass · 0.70
checkpointFunction · 0.50

Tested by

no test coverage detected