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

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