@Test
    public void testReduceOperators1() throws ParseException {
        Tensor x = evaluate("tensor(d0[2],d1[2]):[1, 2, 3, 4]");

        assertEval("reducesum", x, evaluate("tensor(d0[1],d1[1]):[10]"));
        assertEval("reducesum", x, evaluate("tensor(d0[1],d1[1]):[10]"), createAttribute("axes", new int[] {0,1}));
        assertEval("reducesum", x, evaluate("tensor():[10]"), createAttribute("keepdims", 0));
        assertEval("reducesum", x, evaluate("tensor(d0[1],d1[1]):[10]"), createAttribute("keepdims", 1));
        assertEval("reducesum", x, evaluate("tensor(d0[1],d1[2]):[4, 6]"), createAttribute("axes", new int[]{0}));
        assertEval("reducesum", x, evaluate("tensor(d0[2]):[4, 6]"), createAttributes().attr("axes", new int[]{0}).attr("keepdims", 0).build());
        assertEval("reducesum", x, evaluate("tensor(d0[2],d1[1]):[3, 7]"), createAttribute("axes", new int[] {1}));
        assertEval("reducesum", x, evaluate("tensor(d0[2]):[3, 7]"), createAttributes().attr("axes", new int[]{1}).attr("keepdims", 0).build());
        assertEval("reducesum", x, evaluate("tensor(d0[1],d1[2]):[4, 6]"), createAttribute("axes", new int[] {-2}));
        assertEval("reducesum", x, evaluate("tensor(d0[2],d1[1]):[3, 7]"), createAttribute("axes", new int[] {-1}));
        assertEval("reducesum", x, evaluate("tensor(d0[2]):[3, 7]"), createAttributes().attr("axes", new int[] {-1}).attr("keepdims", 0).build());

        assertEval("reduceprod", x, evaluate("tensor(d0[1],d1[1]):[24]"));
        assertEval("reduceprod", x, evaluate("tensor(d0[1],d1[2]):[3, 8]"), createAttribute("axes", new int[] {0}));

        assertEval("reducemin", x, evaluate("tensor(d0[1],d1[1]):[1]"));
        assertEval("reducemin", x, evaluate("tensor(d0[1],d1[2]):[1, 2]"), createAttribute("axes", new int[] {0}));

        assertEval("reducemax", x, evaluate("tensor(d0[1],d1[1]):[4]"));
        assertEval("reducemax", x, evaluate("tensor(d0[1],d1[2]):[3, 4]"), createAttribute("axes", new int[] {0}));

        assertEval("reducemean", x, evaluate("tensor():[2.5]"), createAttribute("keepdims", 0));
        assertEval("reducemean", x, evaluate("tensor(d0[2]):[2, 3]"), createAttributes().attr("axes", new int[] {0}).attr("keepdims", 0).build());

        assertEval("reducelogsum", x, evaluate("tensor():[log(10)]"), createAttribute("keepdims", 0));
        assertEval("reducelogsumexp", x, evaluate("tensor():[log(exp(1)+exp(2)+exp(3)+exp(4))]"), createAttribute("keepdims", 0));
        assertEval("reducesumsquare", x, evaluate("tensor():[1*1+2*2+3*3+4*4]"), createAttribute("keepdims", 0));

        x = evaluate("tensor(d0[1],d1[5]):[-10, -5, 0, 5, 10]");
        assertEval("reducel1", x, evaluate("tensor():[30]"), createAttribute("keepdims", 0));
        assertEval("reducel2", x, evaluate("tensor():[sqrt(10*10 + 5*5 + 5*5 + 10*10)]"), createAttribute("keepdims", 0));
    }
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