| 262 | } |
| 263 | |
| 264 | nb::object structure_sentinel() { |
| 265 | static nb::object sentinel; |
| 266 | |
| 267 | if (sentinel.ptr() == nullptr) { |
| 268 | sentinel = nb::capsule(&sentinel); |
| 269 | // probably not needed but this should make certain that we won't ever |
| 270 | // delete the sentinel |
| 271 | sentinel.inc_ref(); |
| 272 | } |
| 273 | |
| 274 | return sentinel; |
| 275 | } |
| 276 | |
| 277 | std::pair<std::vector<mx::array>, nb::object> tree_flatten_with_structure( |
| 278 | nb::object tree, |
no test coverage detected