Skip to content

Commit

Permalink
only prevent indexing into handles with multiple indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Konolige committed Nov 22, 2021
1 parent 3fa384c commit 6f1a2c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/tvm/script/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,10 @@ def transform_SubscriptAssign(self, node):
span=tvm_span_from_synr(node.span),
)
else:
if symbol.dtype == "handle":
if symbol.dtype == "handle" and len(indexes) != 1:
self.report_error(
"You cannot store to a handle, use `T.match_buffer` to construct a buffer "
"to store to.",
"Handles only support one-dimensional indexing. Use `T.match_buffer` to " \
"construct a multidimensional buffer from a handle.",
node.params[0].span,
)
if len(indexes) != 1:
Expand Down

0 comments on commit 6f1a2c6

Please sign in to comment.