I did change the order(selected_indices first and then nms_indices_label as does make sense, i get that .gather() picks the elements from the param which have the same indices as present in the second param) but then i get this
InvalidArgumentError: indices[1] = 1 is not in [0, 1) [Op:GatherV2]
and the error points to this line itself, so the rest of the code is fine