private static List<Tensor> matrix(int vectorCount, int vectorSize, TensorType.Dimension.Type dimensionType, boolean stringLabels) {
        TensorType.Builder typeBuilder = new TensorType.Builder();
        typeBuilder.dimension(
                "i",
                dimensionType == TensorType.Dimension.Type.indexedBound ? TensorType.Dimension.Type.indexedUnbound : dimensionType
        );
        vectorType(typeBuilder, "x", dimensionType, vectorSize);
        Tensor.Builder builder = Tensor.Builder.of(typeBuilder.build());
        for (int i = 0; i < vectorCount; i++) {
            for (int j = 0; j < vectorSize; j++) {
                if (stringLabels) {
                    builder.cell()
                            .label("i", "l" + i)
                            .label("x", "l" + j)
                            .value(random.nextDouble());
                } else {
                    builder.cell()
                            .label("i", i)
                            .label("x", j)
                            .value(random.nextDouble());
                }
            }
        }
        return List.of(builder.build());
    }
Microbenchmark of tensor operations.

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