Skip to content
Open
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
9 changes: 7 additions & 2 deletions py/torch_tensorrt/dynamo/lowering/_decompositions.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,13 @@ def slice_scatter_decomposition(
dim_size = input_tensor.shape[dim]
device_input_tensor = input_tensor.device

start = 0 if start is None else start # Ensure start is int
start = get_positive_dim(start, input_tensor.shape[dim])
if start is None:
start = 0
elif isinstance(start, int):
start = get_positive_dim(start, dim_size)
elif isinstance(start, torch.SymInt):
if start < 0:
start = start + dim_size
if end is None: # Ensure end is int
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi can you have a testcase for the above?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I tested with my ZoomASR code. Without this, it will crash. After adding this it will run.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info! Generally for any change in the codebase, we recommend adding a corresponding test case to capture the corner case for future CI runs.

end = dim_size
end = (
Expand Down
Loading