diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-11 14:20:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-11 14:20:10 +0100 |
commit | 2d859a4a3f97e600655c699deccdf35d2a59be66 (patch) | |
tree | 5ea75beb84f6577afc4a8141c70dfdf049ec9f70 /vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java | |
parent | 6af036ff1be58aed8806610d5769952ac0192bdc (diff) |
Revert "Revert "Revert "Require equal sizes in join"""
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java b/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java index 5419d04a4fb..1e0eaa7fad3 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/Join.java @@ -48,12 +48,7 @@ public class Join<NAMETYPE extends Name> extends PrimitiveTensorFunction<NAMETYP /** Returns the type resulting from applying Join to the two given types */ public static TensorType outputType(TensorType a, TensorType b) { - try { - return new TensorType.Builder(false, a, b).build(); - } - catch (IllegalArgumentException e) { - throw new IllegalArgumentException("Can not join " + a + " and " + b, e); - } + return new TensorType.Builder(a, b).build(); } public DoubleBinaryOperator combinator() { return combinator; } @@ -80,14 +75,14 @@ public class Join<NAMETYPE extends Name> extends PrimitiveTensorFunction<NAMETYP @Override public TensorType type(TypeContext<NAMETYPE> context) { - return outputType(argumentA.type(context), argumentB.type(context)); + return new TensorType.Builder(argumentA.type(context), argumentB.type(context)).build(); } @Override public Tensor evaluate(EvaluationContext<NAMETYPE> context) { Tensor a = argumentA.evaluate(context); Tensor b = argumentB.evaluate(context); - TensorType joinedType = outputType(a.type(), b.type()); + TensorType joinedType = new TensorType.Builder(a.type(), b.type()).build(); return evaluate(a, b, joinedType, combinator); } |