This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch tqchen/printer-doc-translation
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/tqchen/printer-doc-translation
by this push:
new 90ba9e7990 [FIX][Printer] Preserve runtime attribute values through
metadata
90ba9e7990 is described below
commit 90ba9e7990a5d66f718c3c434b1082dce3d38c7b
Author: Tianqi Chen <[email protected]>
AuthorDate: Wed Sep 30 22:22:51 2026 +0000
[FIX][Printer] Preserve runtime attribute values through metadata
---
src/printer/ir/utils.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/printer/ir/utils.cc b/src/printer/ir/utils.cc
index d04348d181..f441ac091a 100644
--- a/src/printer/ir/utils.cc
+++ b/src/printer/ir/utils.cc
@@ -17,12 +17,14 @@
*/
#include "utils.h"
+#include <tvm/ffi/extra/module.h>
#include <tvm/ffi/extra/structural_visit.h>
#include <tvm/ffi/reflection/accessor.h>
#include <tvm/ir/op.h>
#include <tvm/relax/expr.h>
#include <tvm/relax/global_info.h>
#include <tvm/relax/type.h>
+#include <tvm/runtime/tensor.h>
#include <tvm/target/target.h>
#include <algorithm>
@@ -274,6 +276,7 @@ ExprDoc RawCall(DocTranslatorObj* d, const CallNode* call,
bool infer_result,
ExprDoc AnyValue(DocTranslatorObj* d, ffi::AnyView value) {
if (value.type_index() == ffi::TypeIndex::kTVMFFINone) return
LiteralDoc::None(std::nullopt);
+ if (value.as<ffi::Module>() || value.as<runtime::Tensor>()) return
AddMetadata(d, value);
if (auto array = value.as<ffi::Array<ffi::Any>>()) {
ffi::Array<ExprDoc> elements;
for (const auto& element : array.value()) elements.push_back(AnyValue(d,
element));