I am converting some python numpy code into C++ code using xtensor library. I am having some issues in indexing based operations. Here is the python code:
Python code
boxes = decoded_boxes[keep, :]
keepis a numpy boolean array of dimension[19248]decoded_boxesis a numpy array of dimensions[19248, 4]boxes(output) if a numpy array of dimensions[24, 4]
I am not able to write equivalent code for this. I tried this but did not work.
C++ code
xt::xarray<float> b1 = xt::filter(decoded_boxes, keep);
std::cout << "b1 shape = " << xt::adapt(b1.shape()) << std::endl;
gives only {24}.
I was able to work around as follows: