private static List<Tensor> matrix(int dimension1Size, int dimension2Size, TensorType.Dimension.Type dimensionType) {
        TensorType.Builder typeBuilder = new TensorType.Builder();
        addDimension(typeBuilder, "i", dimensionType, dimension1Size);
        addDimension(typeBuilder, "j", dimensionType, dimension2Size);
        Tensor.Builder builder = Tensor.Builder.of(typeBuilder.build());
        for (int i = 0; i < dimension1Size; i++) {
            for (int j = 0; j < dimension2Size; j++) {
                builder.cell()
                        .label("i", String.valueOf("label" + i))
                        .label("j", String.valueOf("label" + j))
                        .value(random.nextDouble());
            }
        }
        return List.of(builder.build());
    }
Microbenchmark of a "dot product" of two mapped rank 2 tensors

@author bratseth
vespajlib/src/test/java/com/yahoo/tensor/MatrixDotProductBenchmark.java