junrushao commented on code in PR #177:
URL: https://github.com/apache/tvm-ffi/pull/177#discussion_r2445755691


##########
python/tvm_ffi/__init__.py:
##########
@@ -95,3 +95,13 @@
     "use_raw_stream",
     "use_torch_stream",
 ]
+
+
+def _update_module() -> None:
+    for name in __all__:
+        obj = globals()[name]
+        if not getattr(obj, "__module__", "tvm_ffi").startswith("tvm_ffi"):
+            obj.__module__ = "tvm_ffi"
+
+
+_update_module()

Review Comment:
   @tqchen I will need to normalize `__module__` of objects like `core.Object` 
to `tvm_ffi.Object` so that the "as method XXX" part can find the method 
properly (see screenshot). Let me know if it's a reasonable change!
   
   <img width="792" height="261" alt="Image" 
src="https://github.com/user-attachments/assets/b22c27c1-6f5a-4f93-b849-de02493168b2";
 />
   
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to