@Test
    public void testGather1() throws ParseException {
        // 1 dim input, 0 dim indices
        Tensor x = evaluate("tensor(d0[6]):[1,2,3,4,5,6]");
        Tensor y = evaluate("tensor():[0]");
        assertEval("gather", x, y, evaluate("tensor():[1]"));

        // 1 dim input, 1 dim indices
        x = evaluate("tensor(d0[6]):[1,2,3,4,5,6]");
        y = evaluate("tensor(d0[3]):[0,2,4]");
        assertEval("gather", x, y, evaluate("tensor(d0[3]):[1,3,5]"));

        // 2 dim input, 1 dim indices - axis 0
        x = evaluate("tensor(d0[3],d1[2]):[1, 2, 3, 4, 5, 6]");
        y = evaluate("tensor(d0[4]):[2, 1, 0, 2]");
        assertEval("gather", x, y, evaluate("tensor(d0[4],d1[2]):[5, 6, 3, 4, 1, 2, 5, 6]"));

        // 1 dim input, 2 dim indices - axis 0
        x = evaluate("tensor(d0[6]):[1, 2, 3, 4, 5, 6]");
        y = evaluate("tensor(d0[2],d1[2]):[0, 1, 3, 5]");
        assertEval("gather", x, y, evaluate("tensor(d0[2],d1[2]):[1, 2, 4, 6]"));

        // 2 dim input, 2 dim indices - axis 0
        x = evaluate("tensor(d0[3],d1[2]):[1, 2, 3, 4, 5, 6]");
        y = evaluate("tensor(d0[2],d1[2]):[0, 1, 1, 2]");
        assertEval("gather", x, y, evaluate("tensor(d0[2],d1[2],d2[2]):[1, 2, 3, 4, 3, 4, 5, 6]"), createAttribute("axis", -2));

        // 2 dim input, 1 dim indices - axis 1
        x = evaluate("tensor(d0[3],d1[2]):[1, 2, 3, 4, 5, 6]");
        y = evaluate("tensor(d0[4]):[0, 1, 0, 1]");
        assertEval("gather", x, y, evaluate("tensor(d0[3],d1[4]):[1,2,1,2,3,4,3,4,5,6,5,6]"), createAttribute("axis", 1));

        // 2 dim input, 2 dim indices - axis 1
        x = evaluate("tensor(d0[3],d1[3]):[1, 2, 3, 4, 5, 6, 7, 8, 9]");
        y = evaluate("tensor(d0[1],d1[2]):[0, 2]");
        assertEval("gather", x, y, evaluate("tensor(d0[3],d1[1],d2[2]):[1,3,4,6,7,9]"), createAttribute("axis", 1));

        // 1 dim input, 1 dim indices - negative indices
        x = evaluate("tensor(d0[6]):[1,2,3,4,5,6]");
        y = evaluate("tensor(d0[3]):[0,-2,-4]");
        assertEval("gather", x, y, evaluate("tensor(d0[3]):[1,5,3]"));
    }
Unit tests for ONNX operators. The number on the test reflects the minimum
opset number for the operations tested.

@author lesters
model-integration/src/test/java/ai/vespa/rankingexpression/importer/onnx/OnnxOperationsTestCase.java