aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib
diff options
context:
space:
mode:
authorLester Solbakken <lesters@oath.com>2021-04-22 09:31:30 +0200
committerLester Solbakken <lesters@oath.com>2021-04-22 09:31:30 +0200
commit29fd55d44ac78032406a2c7b9b46c7373189f8dd (patch)
tree81dc1fcce414e19a69f0bad4be1b73f67a798981 /vespajlib
parentbd531088df9eb9f7e083fd03d91e5d3f19a1664b (diff)
Wire in tensor cell type resolving for merge in Java
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/functions/Merge.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/functions/Merge.java b/vespajlib/src/main/java/com/yahoo/tensor/functions/Merge.java
index d5633bde36c..4aa09f3f4e3 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/functions/Merge.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/Merge.java
@@ -9,6 +9,7 @@ import com.yahoo.tensor.PartialAddress;
import com.yahoo.tensor.Tensor;
import com.yahoo.tensor.TensorAddress;
import com.yahoo.tensor.TensorType;
+import com.yahoo.tensor.TypeResolver;
import com.yahoo.tensor.evaluation.EvaluationContext;
import com.yahoo.tensor.evaluation.Name;
import com.yahoo.tensor.evaluation.TypeContext;
@@ -48,9 +49,7 @@ public class Merge<NAMETYPE extends Name> extends PrimitiveTensorFunction<NAMETY
/** Returns the type resulting from applying Merge to the two given types */
public static TensorType outputType(TensorType a, TensorType b) {
- Optional<TensorType> outputType = a.dimensionwiseGeneralizationWith(b);
- if (outputType.isPresent()) return outputType.get();
- throw new IllegalArgumentException("Cannot merge " + a + " and " + b + ": Arguments must have compatible types");
+ return TypeResolver.merge(a, b);
}
public DoubleBinaryOperator merger() { return merger; }