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


##########
web/emcc/wasm_runtime.cc:
##########
@@ -145,7 +148,20 @@ void ArrayDecodeStorage(Tensor cpu_arr, std::string bytes, 
std::string format, s
 
 TVM_FFI_STATIC_INIT_BLOCK() {
   namespace refl = tvm::ffi::reflection;
-  refl::GlobalDef().def("tvmjs.array.decode_storage", ArrayDecodeStorage);
+  refl::GlobalDef().def_packed(
+      "tvmjs.array.decode_storage", [](ffi::PackedArgs args, ffi::Any* ret) {
+        Tensor cpu_arr = args[0].cast<Tensor>();
+        auto bytes = args[1].cast<ffi::Bytes>();
+        std::string format = args[2].cast<ffi::String>().operator 
std::string();
+        std::string dtype = args[3].cast<ffi::String>().operator std::string();
+        ArrayDecodeStorage(cpu_arr, bytes, format, dtype);
+        if (ret != nullptr) {

Review Comment:
   This appears to be an workaround but we did not yet know why the return 
value is polluted, would be good to know



-- 
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