Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix assertions in slice_scatter decomposition #3420

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions py/torch_tensorrt/dynamo/lowering/_decompositions.py
Original file line number Diff line number Diff line change
@@ -203,18 +203,18 @@ def slice_scatter_decomposition(
if step is None:
step = 1

# Ensure start, end, and step are all integers
assert isinstance(start, int), "start must be an integer"
assert isinstance(end, int), "end must be an integer"
assert isinstance(step, int), "step must be an integer"

src_dim = src_tensor.shape
# step == 0 is not a valid torch case
# also src_dim should be equal to slice dimension

if start == 0 and end == dim_size and step == 1:
return src_tensor

# Ensure start, end, and step are all integers
assert isinstance(start, int), "start must be an integer"
assert isinstance(end, int), "end must be an integer"
assert isinstance(step, int), "step must be an integer"

cat_tensors = []
index_tensor_shape = []
for i, src_each_dim in enumerate(list(src_dim)):