def test_gather_with_fields_specified(self):
    indices = np.array([2, 0, 1], dtype=int)
    boxlist = self.boxlist
    subboxlist = np_box_list_ops.gather(boxlist, indices, ['labels'])
    self.assertFalse(subboxlist.has_field('scores'))
    expected_boxes = np.array([[0.0, 0.0, 20.0, 20.0], [3.0, 4.0, 6.0, 8.0], [14.0, 14.0, 15.0, 15.0]], dtype=float)
    self.assertAllClose(expected_boxes, subboxlist.get())
    expected_labels = np.array([[0, 0, 0, 0, 1], [0, 0, 0, 1, 0], [0, 1, 0, 0, 0]], dtype=int)
    self.assertAllClose(expected_labels, subboxlist.get_field('labels'))
def test_gather_with_fields_specified(self):
    indices = np.array([2, 0, 1], dtype=int)
    boxlist = self.boxlist
    subboxlist = np_box_list_ops.gather(boxlist, indices, ['labels'])
    self.assertFalse(subboxlist.has_field('scores'))
    expected_boxes = np.array([[0.0, 0.0, 20.0, 20.0], [3.0, 4.0, 6.0, 8.0], [14.0, 14.0, 15.0, 15.0]], dtype=float)
    self.assertAllClose(expected_boxes, subboxlist.get())
    expected_labels = np.array([[0, 0, 0, 0, 1], [0, 0, 0, 1, 0], [0, 1, 0, 0, 0]], dtype=int)
    self.assertAllClose(expected_labels, subboxlist.get_field('labels'))