| 249 | } |
| 250 | |
| 251 | nb::object tree_unflatten( |
| 252 | nb::object tree, |
| 253 | const std::vector<mx::array>& values, |
| 254 | int index /* = 0 */) { |
| 255 | return tree_map(tree, [&](nb::handle obj) { |
| 256 | if (nb::isinstance<mx::array>(obj)) { |
| 257 | return nb::cast(values[index++]); |
| 258 | } else { |
| 259 | return nb::cast<nb::object>(obj); |
| 260 | } |
| 261 | }); |
| 262 | } |
| 263 | |
| 264 | nb::object structure_sentinel() { |
| 265 | static nb::object sentinel; |
no test coverage detected