File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -123,10 +123,10 @@ Supported ONNX input and output tensor data types:
123
123
* String
124
124
125
125
Supported ONNX ops:
126
- * ONNX-Scala, Fine-grained API: 87/178 total (69/178 when using Scala.js / ORT Web backend)
127
- * ONNX-Scala, Full model API: Same as below, depending on backend
126
+ * ONNX-Scala, Fine-grained API: 87/178 total
127
+ * ONNX-Scala, Full model API: Same as below
128
128
129
- * ONNX Runtime Web (using WebGL backend): 69 /178 total.
129
+ * ONNX Runtime Web (using Wasm backend): 165 /178 total.
130
130
* ONNX Runtime: 165/178 total
131
131
132
132
See the [ ONNX backend scoreboard] ( http://onnx.ai/backend-scoreboard/index.html )
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ trait ORTWebOperatorBackend extends OpToONNXBytesConverter {
40
40
InferenceSession
41
41
] = IO .fromFuture(IO { OrtSession .create(bytesArrayBuffer, {
42
42
val opts = InferenceSession .SessionOptions ()
43
- opts.executionProviders = scala.scalajs.js.Array (" webgl " )
43
+ opts.executionProviders = scala.scalajs.js.Array (" wasm " )
44
44
opts
45
45
}
46
46
).toFuture })
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import org.scalatest.flatspec.AsyncFlatSpec
16
16
import org .scalatest .freespec .AsyncFreeSpec
17
17
import org .scalatest .matchers .should ._
18
18
import cats .effect .testing .scalatest .AsyncIOSpec
19
+ import org .emergentorder .onnx .onnxruntimeCommon .inferenceSessionMod .InferenceSession
19
20
20
21
class ONNXScalaSpec extends AsyncFreeSpec with AsyncIOSpec with Matchers {
21
22
@@ -24,7 +25,13 @@ class ONNXScalaSpec extends AsyncFreeSpec with AsyncIOSpec with Matchers {
24
25
// TODO: push this inside ORTWebModelBackend, and use other create() which takes arraybufferlike
25
26
val session : IO [
26
27
org.emergentorder.onnx.onnxruntimeCommon.inferenceSessionMod.InferenceSession
27
- ] = IO .fromFuture(IO { OrtSession .create(" squeezenet1.0-12.onnx" ).toFuture })
28
+ ] = IO .fromFuture(IO { OrtSession .create(" squeezenet1.0-12.onnx" ,
29
+ {
30
+ val opts = InferenceSession .SessionOptions ()
31
+ opts.executionProviders = scala.scalajs.js.Array (" wasm" )
32
+ opts
33
+ }
34
+ ).toFuture })
28
35
29
36
" SqueezeNet ONNX-Scala model should predict dummy image class" in {
30
37
val squeezenet = new ORTWebModelBackend (session)
You can’t perform that action at this time.
0 commit comments