diff options
author | Arne Juul <arnej@vespa.ai> | 2023-11-02 08:47:23 +0000 |
---|---|---|
committer | Arne Juul <arnej@vespa.ai> | 2023-11-02 19:54:24 +0000 |
commit | bd9d7a9f74d41f2e88694aa2f1629ced0bca6428 (patch) | |
tree | af40320eae453618b6c00b854f2cf5d72d17e26e /vespajlib/src/main/java/com/yahoo/tensor/TensorType.java | |
parent | 96f6abe9caa338074ee39cb2fd566d3efff464c9 (diff) |
add reference implementation of MapSubspaces
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/tensor/TensorType.java')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/TensorType.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java index 084eaf2bf98..7f890a9ec51 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java @@ -80,7 +80,7 @@ public class TensorType { }; /** The empty tensor type - which is the same as a double */ - public static final TensorType empty = new TensorType(Value.DOUBLE, Collections.emptyList()); + public static final TensorType empty = new TensorType(); private final Value valueType; @@ -90,6 +90,13 @@ public class TensorType { private final TensorType mappedSubtype; private final TensorType indexedSubtype; + private TensorType() { + this.valueType = Value.DOUBLE; + this.dimensions = List.of(); + this.mappedSubtype = this; + this.indexedSubtype = this; + } + public TensorType(Value valueType, Collection<Dimension> dimensions) { this.valueType = valueType; List<Dimension> dimensionList = new ArrayList<>(dimensions); |