You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2025/08/01 23:40:54 UTC

(tvm) 02/02: checkin

This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch json-small-str
in repository https://gitbox.apache.org/repos/asf/tvm.git

commit 287e5cb33b333e232de0112ca6d27dcdba477403
Author: tqchen <ti...@gmail.com>
AuthorDate: Wed Jul 30 17:27:02 2025 -0400

    checkin
---
 src/runtime/vm/ndarray_cache_support.cc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/runtime/vm/ndarray_cache_support.cc b/src/runtime/vm/ndarray_cache_support.cc
index d91669016d..31f11e7ee7 100644
--- a/src/runtime/vm/ndarray_cache_support.cc
+++ b/src/runtime/vm/ndarray_cache_support.cc
@@ -378,7 +378,14 @@ TVM_FFI_STATIC_INIT_BLOCK({
                       names.push_back(args[i].cast<String>());
                     }
                     *rv = ParamModuleNode::GetParamByName(names);
-                  });
+                  })
+    .def("ffi.picojson.parse", [](const String& json_str) {
+        picojson::value json_info;
+        std::string err = picojson::parse(json_info, json_str);
+        if (!err.empty()) {
+          LOG(FATAL) << "Failed to parse JSON: err. The JSON string is:" << json_str;
+        }
+      });
 });
 
 }  // namespace vm