Skip to content

Commit afdef12

Browse files
chore: adding NoneConst and None check
1 parent d34ed95 commit afdef12

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pymc/logprob/mixture.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,14 @@ def find_measurable_index_mixture(fgraph, node):
289289
# We don't support (non-scalar) integer array indexing as it can pick repeated values,
290290
# but the Mixture logprob assumes all mixture values are independent
291291
if any(
292-
indices.dtype.startswith("int") and sum(1 - b for b in indices.type.broadcastable) > 0
292+
(
293+
isinstance(indices, (type(NoneConst), type(None)))
294+
or
295+
(
296+
indices.dtype.startswith("int") and
297+
sum(1 - b for b in indices.type.broadcastable) > 0
298+
)
299+
)
293300
for indices in mixing_indices
294301
if not isinstance(indices, SliceConstant)
295302
):

0 commit comments

Comments
 (0)