The formula gives an error, how can I change it?
YoungjaeDev opened this issue · comments
youngjae-you commented
The below expression gives an error
Looking at the code, I want to pick out all the items whose column 5 is i, but it seems that an error occurs on the operator side. How can I not do that?
func (std::vector<std::vector<float>>& obj_list)
nc::NdArray<float> nd_predictions{obj_list}
for (int i = 0; i < class_num; i++)
{
auto [rowIndices, _] = (nd_predictions(nd_predictions.rSlice(), 5) == i).nonzero(); //error
...
}
David Pilger commented
You are trying to compare floats and ints and there isn't an operator == defined for that. You could change it to static_cast<float>(i)
.