Closed i10416 closed 1 year ago
Yes, there is native resource allocation, under the hood ONNX Runtime is used and data needs to copied from the JVM into native memory. In addition to this, the transition to using IO here allows for the Scala JVM and Scala JS (JavaScript) APIs to be unified, because onnxruntime-web and onnxruntime-node return Promises, which cannot be awaited because blocking is not allowed in ScalaJS (see: https://github.com/scala-js/scala-js/issues/186#issuecomment-33732043 ).
Why does
Tensor#apply
return a value wrapped inIO
effect?Is there any resource allocation or unsafe invocation to native land?