junrushao commented on code in PR #12496:
URL: https://github.com/apache/tvm/pull/12496#discussion_r1020621395


##########
python/tvm/tir/buffer.py:
##########
@@ -187,13 +187,11 @@ def __getitem__(self, indices):
         if any(isinstance(index, slice) and index.step is None for index in 
indices):
             region = []
             analyzer = Analyzer()
-            for index in indices:
+            for i, index in zip(range(len(indices)), indices):
                 if isinstance(index, slice):
-                    region.append(
-                        Range.from_min_extent(
-                            index.start, analyzer.simplify(index.stop - 
index.start)
-                        )
-                    )
+                    start = 0 if index.start is None else index.start
+                    stop = self.shape[i] if index.stop is None else index.stop
+                    region.append(Range.from_min_extent(start, 
analyzer.simplify(stop - start)))

Review Comment:
   yep we don't allow non-trivial `index.step` here



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