tqchen commented on a change in pull request #10843:
URL: https://github.com/apache/tvm/pull/10843#discussion_r839583706



##########
File path: tests/python/unittest/test_tir_transform_regenerate_def.py
##########
@@ -0,0 +1,94 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import pytest
+import sys
+
+import tvm
+from tvm.script import tir as T
+from tvm.tir.function import PrimFunc
+from tvm.tir.stmt import Block
+
+
+def _check_func_signature(lhs: PrimFunc, rhs: PrimFunc):
+    for x, y in zip(lhs.params, rhs.params):
+        assert x != y
+        assert lhs.buffer_map[x] != rhs.buffer_map[y]
+
+
+def _check_block_signature(lhs: Block, rhs: Block):
+    for x, y in zip(lhs.iter_vars, rhs.iter_vars):
+        assert x != y
+    for x, y in zip(lhs.alloc_buffers, rhs.alloc_buffers):
+        assert x != y
+    for x, y in zip(lhs.match_buffers, rhs.match_buffers):
+        assert x != y
+
+
+def test_simple():
+    @T.prim_func
+    def elementwise(A: T.Buffer[(128, 128), "float32"], C: T.Buffer[(128, 
128), "float32"]):
+        B = T.alloc_buffer((128, 128), "float32")

Review comment:
       would be great to comment out the defs that we are testing, e.g. 
   
   ```
          # B should be remapped
           B = T.alloc_buffer((128, 128), "float32")
   
   ```




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