akaashrp commented on code in PR #18415:
URL: https://github.com/apache/tvm/pull/18415#discussion_r2485180271


##########
web/src/runtime.ts:
##########
@@ -1396,7 +1396,18 @@ export class Instance implements Disposable {
           });
           const recSource = buffer.slice(rec.byteOffset, rec.byteOffset + 
rec.nbytes);
           // first sync copy to cpu.
-          this.ctx.arrayDecodeStorage(cpu_arr, new Uint8Array(recSource), 
rec.format, rec.dtype);
+          this.withNewScope(() => {
+            const retValue = this.ctx.arrayDecodeStorage(

Review Comment:
   I've documented the rationale in the PR description. If you'd like, I can 
add a comment in the code too. I've updated the error handling in the catch 
block to throw when the error is not something related to the object not being 
found in the current scope. I don't think there's a better way than a try-catch 
to avoid throwing an error in the aforementioned case - maybe creating an if 
block that mirrors the if-else conditions in ArrayDecodeStorage 
(wasm_runtime.cc)?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to