diff options
author | Arne Juul <arnej@verizonmedia.com> | 2021-04-09 09:39:19 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2021-04-09 10:31:37 +0000 |
commit | ae5e083869e8beb5ef588fff790b9e2dbc7ec5d9 (patch) | |
tree | 570ce12549a616e2508bf29399839a54f23f6f83 /vespajlib | |
parent | 527eada361b1000fc28cca04a7234845c2df839c (diff) |
cosmetic tweaks
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/abi-spec.json | 4 | ||||
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/TensorType.java | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/vespajlib/abi-spec.json b/vespajlib/abi-spec.json index 9ad2c55f7e3..6d99eeac816 100644 --- a/vespajlib/abi-spec.json +++ b/vespajlib/abi-spec.json @@ -1412,8 +1412,8 @@ "fields": [ "public static final enum com.yahoo.tensor.TensorType$Value DOUBLE", "public static final enum com.yahoo.tensor.TensorType$Value FLOAT", - "public static final enum com.yahoo.tensor.TensorType$Value INT8", - "public static final enum com.yahoo.tensor.TensorType$Value BFLOAT16" + "public static final enum com.yahoo.tensor.TensorType$Value BFLOAT16", + "public static final enum com.yahoo.tensor.TensorType$Value INT8" ] }, "com.yahoo.tensor.TensorType": { diff --git a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java index 0f67c25337b..7867a53b8da 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java @@ -33,7 +33,7 @@ public class TensorType { public enum Value { // Types added must also be added to TensorTypeParser.parseValueTypeSpec, serialization, and largestOf below - DOUBLE("double"), FLOAT("float"), INT8("int8"), BFLOAT16("bfloat16"); + DOUBLE("double"), FLOAT("float"), BFLOAT16("bfloat16"), INT8("int8"); private final String id; @@ -61,14 +61,15 @@ public class TensorType { if (value1 == DOUBLE || value2 == DOUBLE) return DOUBLE; if (value1 == FLOAT || value2 == FLOAT) return FLOAT; if (value1 == BFLOAT16 || value2 == BFLOAT16) return BFLOAT16; - return INT8; + if (value1 == INT8 && value2 == INT8) return INT8; + throw new IllegalArgumentException("Cannot find largest of "+value1+" and "+value2); } @Override public String toString() { return name().toLowerCase(); } public static Value fromId(String valueTypeString) { - for(Value value : Value.values()) { + for (Value value : values()) { if (value.id.equals(valueTypeString)) { return value; } |