Open
Description
Description
The rewrite local_useless_slice
canonicalizes slicing operations so that x[0:-1:2]
and x[::2]
are made equivalent.
This should also apply to IncSubtensor
operations with slices where x[0:-1:2].set(y)
and x[::2].set(y)
are made equivalent. The only difference is the branch where we find zero indices and just return x
, in that case for the IncSubtensor, we should return full_like(x, y)
pytensor/pytensor/tensor/rewriting/subtensor.py
Lines 337 to 406 in b8dbd4c