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/05/04 17:04:38 UTC

(tvm) 07/08: Pass through tir-transform

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

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

commit c294bb45a8836080911ce07ceaf94afc3c934c72
Author: tqchen <ti...@gmail.com>
AuthorDate: Sun May 4 12:22:56 2025 -0400

    Pass through tir-transform
---
 python/tvm/ffi/cython/object.pxi                               |  8 --------
 .../python/tir-transform/test_tir_transform_make_packed_api.py | 10 +++-------
 2 files changed, 3 insertions(+), 15 deletions(-)

diff --git a/python/tvm/ffi/cython/object.pxi b/python/tvm/ffi/cython/object.pxi
index 8a9f09183a..436d0691f7 100644
--- a/python/tvm/ffi/cython/object.pxi
+++ b/python/tvm/ffi/cython/object.pxi
@@ -115,14 +115,6 @@ cdef class Object:
         cdef uint64_t hash_value = <uint64_t>self.chandle
         return hash_value
 
-    def __eq__(self, other):
-        if not isinstance(other, Object):
-            return False
-        return self.chandle == (<Object>other).chandle
-
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
     def _move(self):
         """Create an RValue reference to the object and mark the object as moved.
 
diff --git a/tests/python/tir-transform/test_tir_transform_make_packed_api.py b/tests/python/tir-transform/test_tir_transform_make_packed_api.py
index fdc67c76f9..49bfa75b72 100644
--- a/tests/python/tir-transform/test_tir_transform_make_packed_api.py
+++ b/tests/python/tir-transform/test_tir_transform_make_packed_api.py
@@ -16,7 +16,7 @@
 # under the License.
 
 import pytest
-
+import numpy as np
 import tvm
 import tvm.testing
 from tvm import te, tir
@@ -214,11 +214,9 @@ def test_function_call_with_null_data_pointer():
 
     built = tvm.compile(func, target="llvm")
 
-    A = tvm.nd.empty([16, 16], "int32", tvm.cpu())
+    A = tvm.nd.array(np.zeros([16], dtype="int32"))
     B = tvm.nd.empty([16, 16], "int32", tvm.cpu())
 
-    A.handle.contents.data = 0
-
     with pytest.raises(tvm.TVMError):
         built(A, B)
 
@@ -233,11 +231,9 @@ def test_function_call_with_wrong_dimensionality():
 
     built = tvm.compile(func, target="llvm")
 
-    A = tvm.nd.empty([16], "int32", tvm.cpu())
+    A = tvm.nd.array(np.zeros([16], dtype="int32"))
     B = tvm.nd.empty([16], "int32", tvm.cpu())
 
-    A.handle.contents.data = 0
-
     with pytest.raises(tvm.TVMError):
         built(A, B)