add handling of out-of-range indices to Slice (#3689)
Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/3689
Seeing some ops in graph like:
```aten edge dialect
new_k[-self.left_context :, :, :],
slice_66: "f32[10, 1, 256]" = torch.ops.aten.slice.Tensor(cat_8, 0, -10, 9223372036854775807); cat_8 = None
```
Negative indices and 9223372036854775807 are valid inputs to `start` and `end` params on slice op, but runtime checks in Slice.cpp don't accept them.
(9223372036854775807 is the max value of signed int_64; it maps to the index not being provided.)
Adding code to compute the real values to the range [0, size(dim))
Reviewed By: jorgep31415
Differential Revision: D57597106
fbshipit-source-id: 594651ffcc34df2fda6d164454b0f57cc26a71de N
Nathanael See committed
b8f92dfe48cdce37aafa4ea31982e75c201ad674
Parent: c937ece
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 5/25/2024, 1:12:44 AM