Skip to content

Commit

Permalink
[onnx] upgrade OnnxRuntime to 1.9.0 and add UINT8 support (#1271)
Browse files Browse the repository at this point in the history
Change-Id: I7c6a2c3608bbaa969b454d705045218c596a9366
  • Loading branch information
frankfliu authored Oct 5, 2021
1 parent 92bd17c commit a994dbe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions engines/onnxruntime/onnxruntime-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Maven:
<dependency>
<groupId>com.microsoft.onnxruntime</groupId>
<artifactId>onnxruntime_gpu</artifactId>
<version>1.8.1</version>
<version>1.9.0</version>
<scope>runtime</scope>
</dependency>
```
Expand All @@ -83,5 +83,5 @@ Gradle:
implementation("ai.djl.onnxruntime:onnxruntime-engine:0.12.0") {
exclude group: "com.microsoft.onnxruntime", module: "onnxruntime"
}
implementation "com.microsoft.onnxruntime:onnxruntime_gpu:1.8.1"
implementation "com.microsoft.onnxruntime:onnxruntime_gpu:1.9.0"
```
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ public static OnnxTensor toTensor(
case INT64:
return OnnxTensor.createTensor(env, (LongBuffer) data, sh);
case INT8:
case UINT8:
return OnnxTensor.createTensor(env, (ByteBuffer) data, sh, OnnxJavaType.INT8);
case UINT8:
return OnnxTensor.createTensor(env, (ByteBuffer) data, sh, OnnxJavaType.UINT8);
case STRING:
throw new UnsupportedOperationException(
"Use toTensor(OrtEnvironment env, String[] inputs, Shape shape) instead.");
Expand Down Expand Up @@ -79,6 +80,8 @@ public static DataType toDataType(OnnxJavaType javaType) {
return DataType.FLOAT64;
case INT8:
return DataType.INT8;
case UINT8:
return DataType.UINT8;
case INT32:
return DataType.INT32;
case INT64:
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tensorflow_version=2.4.1
tflite_version=2.4.1
dlr_version=1.6.0
trt_version=8.0.1
onnxruntime_version=1.8.1
onnxruntime_version=1.9.0
paddlepaddle_version=2.0.2
sentencepiece_version=0.1.95
fasttext_version=0.9.2
Expand Down

0 comments on commit a994dbe

Please sign in to comment.