aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/main/java/com
diff options
context:
space:
mode:
authorArne Juul <arnej@vespa.ai>2023-12-14 08:26:50 +0000
committerArne Juul <arnej@vespa.ai>2023-12-14 08:26:50 +0000
commit990aab34103e545f17f3e05b02a6b2f7bcdca05c (patch)
treeebde890e7fd9f58a129cafc36a2fa75846fd55e7 /document/src/main/java/com
parent1ad5ec5fa814a92fdbf98db14121197023f434f0 (diff)
Reapply "add parsing of special strings for inf/nan cell values"
This reverts commit d976f82207c09b3215661e1d034ae9a42f28a63d.
Diffstat (limited to 'document/src/main/java/com')
-rw-r--r--document/src/main/java/com/yahoo/document/json/readers/TensorReader.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/document/src/main/java/com/yahoo/document/json/readers/TensorReader.java b/document/src/main/java/com/yahoo/document/json/readers/TensorReader.java
index e487fd2ec57..0b7b1ae9996 100644
--- a/document/src/main/java/com/yahoo/document/json/readers/TensorReader.java
+++ b/document/src/main/java/com/yahoo/document/json/readers/TensorReader.java
@@ -14,6 +14,7 @@ import com.yahoo.tensor.TensorType;
import static com.yahoo.document.json.readers.JsonParserHelpers.*;
import static com.yahoo.tensor.serialization.JsonFormat.decodeHexString;
+import static com.yahoo.tensor.serialization.JsonFormat.decodeNumberString;
/**
* Reads the tensor format defined at
@@ -243,6 +244,9 @@ public class TensorReader {
private static double readDouble(TokenBuffer buffer) {
try {
+ if (buffer.current() == JsonToken.VALUE_STRING) {
+ return decodeNumberString(buffer.currentText());
+ }
return Double.parseDouble(buffer.currentText());
}
catch (NumberFormatException e) {