Otherwise, numpy coercion kicks in, and an argument like np.asarray([42]) gets coerced to 42, the scalar binding is used, and then we convert it to a std::vector internally.
not only is this inefficient, newer numpy versions emit:
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future.
Ensure you extract a single element from your array before performing this operation.
(Deprecated NumPy 1.25.)
np.asarray([42])
gets coerced to 42, the scalar binding is used, and then we convert it to a std::vector internally.not only is this inefficient, newer numpy versions emit:
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)