diff options
author | Lester Solbakken <lesters@oath.com> | 2020-11-15 12:56:50 +0100 |
---|---|---|
committer | Lester Solbakken <lesters@oath.com> | 2020-11-15 12:56:50 +0100 |
commit | 288ef3a1fbc3b1db5c54ab55b5d76d1feedeab0c (patch) | |
tree | 0908f8b5b5df6d2d3fa49930fbc149b183c7fea2 /vespajlib/src | |
parent | 8626f8690482c85e6e6e7350aa024dde528fccf9 (diff) |
Support mixed tensor type in Java evaluation
Diffstat (limited to 'vespajlib/src')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/TensorType.java | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java index d8959147ee0..790743c745c 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java @@ -520,27 +520,9 @@ public class TensorType { } } - private static final boolean supportsMixedTypes = false; - private void addDimensionsOf(TensorType type, boolean allowDifferentSizes) { - if ( ! supportsMixedTypes) { // TODO: Support it - addDimensionsOfAndDisallowMixedDimensions(type, allowDifferentSizes); - } - else { - for (Dimension dimension : type.dimensions) - set(dimension.combineWith(Optional.ofNullable(dimensions.get(dimension.name())), allowDifferentSizes)); - } - } - - private void addDimensionsOfAndDisallowMixedDimensions(TensorType type, boolean allowDifferentSizes) { - boolean containsMapped = dimensions.values().stream().anyMatch(d -> ! d.isIndexed()); - containsMapped = containsMapped || type.dimensions().stream().anyMatch(d -> ! d.isIndexed()); - for (Dimension dimension : type.dimensions) { - if (containsMapped) - dimension = new MappedDimension(dimension.name()); - Dimension existing = dimensions.get(dimension.name()); - set(dimension.combineWith(Optional.ofNullable(existing), allowDifferentSizes)); + set(dimension.combineWith(Optional.ofNullable(dimensions.get(dimension.name())), allowDifferentSizes)); } } |