MCPcopy Create free account
hub / github.com/ml-explore/mlx / tree_fill

Function tree_fill

python/src/trees.cpp:212–216  ·  view source on GitHub ↗

Fill a pytree (recursive dict or list of dict or list) in place with the given arrays Non dict or list nodes are ignored

Source from the content-addressed store, hash-verified

210// in place with the given arrays
211// Non dict or list nodes are ignored
212void tree_fill(nb::object& tree, const std::vector<mx::array>& values) {
213 size_t index = 0;
214 tree_visit_update(
215 tree, [&](nb::handle node) { return nb::cast(values[index++]); });
216}
217
218// Replace all the arrays from the src values with the dst values in the tree
219void tree_replace(

Callers 2

py_value_and_gradFunction · 0.85
call_implMethod · 0.85

Calls 1

tree_visit_updateFunction · 0.85

Tested by

no test coverage detected