diff options
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 | 14 |
1 files changed, 1 insertions, 13 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 30b36e83457..8ab23c8d77c 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/serialization/SparseBinaryFormat.java @@ -54,24 +54,12 @@ class SparseBinaryFormat implements BinaryFormat { @Override public Tensor decode(TensorType type, GrowableByteBuffer buffer) { - if (type == null) // TODO (January 2017): Remove this when types are available - type = decodeDimensionsToType(buffer); - else - consumeAndValidateDimensions(type, buffer); + consumeAndValidateDimensions(type, buffer); Tensor.Builder builder = Tensor.Builder.of(type); decodeCells(buffer, builder, type); return builder.build(); } - private TensorType decodeDimensionsToType(GrowableByteBuffer buffer) { - TensorType.Builder builder = new TensorType.Builder(); - int numDimensions = buffer.getInt1_4Bytes(); - for (int i = 0; i < numDimensions; ++i) { - builder.mapped(buffer.getUtf8String()); - } - return builder.build(); - } - private void consumeAndValidateDimensions(TensorType type, GrowableByteBuffer buffer) { int dimensionCount = buffer.getInt1_4Bytes(); if (type.dimensions().size() != dimensionCount) |