I am defining a method that takes py::array_t< double > and py::array_t< bool > as arguments. How can I tell pybind11 to default those arguments to an array of my choice? (say np.array([0, 0, 0]))
I have tried adding the default via "Argument"_a = py::array_T({0, 0, 0}) but when I call it itells me 'array has incorrect number of dimensions: 3; expected 1'
m.def("foo", [](py::array_t<double> Arg1,
py::array_t<bool> Arg2){
auto bar = Arg1.unchecked<1>();
auto bar2 = Arg2.unchecked<1>();
'''other simple code that doesn't alter bar or bar2'''
return bar;
},
"Arg1"_a,
"Arg2"_a = py_array<bool> ({0, 0, 0})
);