private static double decodeNumeric(Inspector numericField) {
        if (numericField.type() == Type.DOUBLE || numericField.type() == Type.LONG) {
            return numericField.asDouble();
        }
        if (numericField.type() == Type.STRING) {
            return decodeNumberString(numericField.asString());
        }
        if (numericField.type() == Type.NIX) {
            return Double.NaN;
        }
        throw new IllegalArgumentException("Excepted a number, not " + numericField.type());
    }
Decodes a tensor value directly at the root, where the format is decided by the tensor type.
vespajlib/src/main/java/com/yahoo/tensor/serialization/JsonFormat.java