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

More robust check for multiple integer indices in numba ravel_multidimensional_idx rewrites #1139

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
6 changes: 3 additions & 3 deletions pytensor/tensor/rewriting/subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
inc_subtensor,
indices_from_subtensor,
)
from pytensor.tensor.type import TensorType
from pytensor.tensor.type import TensorType, integer_dtypes
from pytensor.tensor.type_other import NoneTypeT, SliceConstant, SliceType
from pytensor.tensor.variable import TensorConstant, TensorVariable

Expand Down Expand Up @@ -1981,7 +1981,7 @@ def ravel_multidimensional_bool_idx(fgraph, node):

if any(
(
(isinstance(idx.type, TensorType) and idx.type.dtype.startswith("int"))
(isinstance(idx.type, TensorType) and idx.type.dtype in integer_dtypes)
or isinstance(idx.type, NoneTypeT)
)
for idx in idxs
Expand Down Expand Up @@ -2052,7 +2052,7 @@ def ravel_multidimensional_int_idx(fgraph, node):
int_idxs = [
(i, idx)
for i, idx in enumerate(idxs)
if (isinstance(idx.type, TensorType) and idx.dtype.startswith("int"))
if (isinstance(idx.type, TensorType) and idx.dtype in integer_dtypes)
]

if len(int_idxs) != 1:
Expand Down
Loading