diff options
Diffstat (limited to 'vespajlib/src/test/java/com/yahoo/tensor/MatrixDotProductBenchmark.java')
-rw-r--r-- | vespajlib/src/test/java/com/yahoo/tensor/MatrixDotProductBenchmark.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/tensor/MatrixDotProductBenchmark.java b/vespajlib/src/test/java/com/yahoo/tensor/MatrixDotProductBenchmark.java index 439aac5578a..9c4fa0cf931 100644 --- a/vespajlib/src/test/java/com/yahoo/tensor/MatrixDotProductBenchmark.java +++ b/vespajlib/src/test/java/com/yahoo/tensor/MatrixDotProductBenchmark.java @@ -2,6 +2,7 @@ package com.yahoo.tensor; import com.yahoo.tensor.evaluation.MapEvaluationContext; +import com.yahoo.tensor.evaluation.TypeContext; import com.yahoo.tensor.evaluation.VariableTensor; import com.yahoo.tensor.functions.ConstantTensor; import com.yahoo.tensor.functions.Join; @@ -42,10 +43,10 @@ public class MatrixDotProductBenchmark { private double dotProduct(Tensor tensor, List<Tensor> tensors) { double largest = Double.MIN_VALUE; - TensorFunction dotProductFunction = new Reduce(new Join(new ConstantTensor(tensor), - new VariableTensor("argument"), (a, b) -> a * b), - Reduce.Aggregator.sum).toPrimitive(); - MapEvaluationContext context = new MapEvaluationContext(); + TensorFunction<TypeContext.Name> dotProductFunction = new Reduce<>(new Join<>(new ConstantTensor<>(tensor), + new VariableTensor<>("argument"), (a, b) -> a * b), + Reduce.Aggregator.sum).toPrimitive(); + MapEvaluationContext<TypeContext.Name> context = new MapEvaluationContext<>(); for (Tensor tensorElement : tensors) { // tensors.size() = 1 for larger tensor context.put("argument", tensorElement); |