pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

AdvancedSubtensor1 and AdvancedIncSubtensor1 are not needed in JAX and Numba backends

Open ricardoV94 opened this issue 8 months ago • 0 comments

Description

AdvancedSubtensor1 and AdvancedIncSubtensor1 are specializations of AdvancedSubtensor and AdvancedIncSubtensor that only allow one vector of integer indexing along the first dimension. They exist to provide a C-implementation of this more restricted form of advanced indexing (the other Ops just use Python code), with some rewrites that try to convert from general form by transposing/reshaping stuff back and forth.

These shouldn't be needed in the JAX/Numba backends, because those backends already support a single dimension index wherever it may be, so no need for the rewrite that introduces those in the backends?

Well AdvancedIncSubtensor1 may still be fine in the Numba backend for now, we have some specialized implementations for those.

We should check we have no other useful rewrites that depend on these specialized Ops

ricardoV94 avatar Jun 21 '24 09:06 ricardoV94