diff options
author | Geir Storli <geirst@yahoo-inc.com> | 2016-12-07 11:04:35 +0100 |
---|---|---|
committer | Geir Storli <geirst@yahoo-inc.com> | 2016-12-07 11:04:35 +0100 |
commit | 9076183a6d0a192e0897a29a525b11d568561dbf (patch) | |
tree | 52d6a5b9615803c34ded484778fdfc0340ba3d12 /vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java | |
parent | 035938c340921d66b414136fec32d32eb78aac1f (diff) |
Allow serialization of all tensors using the sparse binary format as before.
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java b/vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java index b707802c55f..2637ce5229c 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java @@ -34,8 +34,6 @@ class SparseBinaryFormat implements BinaryFormat { private static void encodeDimensions(GrowableByteBuffer buffer, List<TensorType.Dimension> sortedDimensions) { buffer.putInt1_4Bytes(sortedDimensions.size()); for (TensorType.Dimension dimension : sortedDimensions) { - if ( ! (dimension instanceof TensorType.MappedDimension)) - throw new UnsupportedOperationException("Serialization of indexed tensors is no not implemented"); encodeString(buffer, dimension.name()); } } @@ -49,8 +47,9 @@ class SparseBinaryFormat implements BinaryFormat { } private static void encodeAddress(GrowableByteBuffer buffer, TensorAddress address) { - for (String label : address.labels()) + for (String label : address.labels()) { encodeString(buffer, label); + } } private static void encodeString(GrowableByteBuffer buffer, String value) { |