From ac09f9c90be29e19583d78649807a9587118741b Mon Sep 17 00:00:00 2001 From: Lester Solbakken Date: Thu, 16 Nov 2017 10:54:01 +0100 Subject: Java tensors: support unequal size when concatenating --- vespajlib/src/main/java/com/yahoo/tensor/functions/Concat.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'vespajlib/src/main/java/com/yahoo/tensor') diff --git a/vespajlib/src/main/java/com/yahoo/tensor/functions/Concat.java b/vespajlib/src/main/java/com/yahoo/tensor/functions/Concat.java index 401f9a10eda..1dbb94fdb20 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/functions/Concat.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/Concat.java @@ -134,9 +134,7 @@ public class Concat extends PrimitiveTensorFunction { if (currentDimension.equals(concatDimension)) concatSizes.set(i, aSize + bSize); else if (aSize != 0 && bSize != 0 && aSize!=bSize ) - throw new IllegalArgumentException("Dimension " + currentDimension + " must be of the same size when " + - "concatenating " + a.type() + " and " + b.type() + " along dimension " + - concatDimension + ", but was " + aSize + " and " + bSize); + concatSizes.set(i, Math.min(aSize, bSize)); else concatSizes.set(i, Math.max(aSize, bSize)); } -- cgit v1.2.3