79128714

Date: 2024-10-26 14:20:50
Score: 0.5
Natty:
Report link

Found the problem.

It was outdated python-optree package. Seems that 0.13.0 version doesn't have the issue.

The issue was:

>>> from optree import *
>>> tree_map(lambda x: x, ())
/usr/include/c++/14.1.1/bits/stl_vector.h:1130: constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = pybind11::object; _Alloc = std::allocator<pybind11::object>; reference = pybind11::object&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
fish: Job 1, 'python' terminated by signal SIGABRT (Abort)

Empty tuples or arrays raised the issue.

In version 0.13.0:

>>> from optree import *
>>> tree_map(lambda x: x, ())
()

It's not trowing and everything works.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: helf4ch