Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 1366221

Browse files
Use the correct dtype object in numba_funcify_CAReduce
1 parent 248ce6d commit 1366221

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

aesara/link/numba/dispatch.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,24 +519,22 @@ def numba_funcify_CAReduce(op, node, **kwargs):
519519

520520
scalar_op_identity = np.asarray(op.scalar_op.identity, dtype=np_acc_dtype)
521521

522-
acc_dtype = numba.np.numpy_support.from_dtype(np_acc_dtype)
523-
524522
scalar_nfunc_spec = op.scalar_op.nfunc_spec
525523

526524
# We construct a dummy `Apply` that has the minimum required number of
527525
# inputs for the scalar `Op`. Without this, we would get a scalar function
528526
# with too few arguments.
529527
dummy_node = Apply(
530528
op,
531-
[tensor(acc_dtype, [False]) for i in range(scalar_nfunc_spec[1])],
532-
[tensor(acc_dtype, [False]) for o in range(scalar_nfunc_spec[2])],
529+
[tensor(np_acc_dtype, [False]) for i in range(scalar_nfunc_spec[1])],
530+
[tensor(np_acc_dtype, [False]) for o in range(scalar_nfunc_spec[2])],
533531
)
534532
elemwise_fn = numba_funcify_Elemwise(op, dummy_node, use_signature=True, **kwargs)
535533

536534
input_name = get_name_for_object(node.inputs[0])
537535
ndim = node.inputs[0].ndim
538536
careduce_fn = create_multiaxis_reducer(
539-
elemwise_fn, scalar_op_identity, axes, ndim, acc_dtype, input_name=input_name
537+
elemwise_fn, scalar_op_identity, axes, ndim, np_acc_dtype, input_name=input_name
540538
)
541539

542540
return numba.njit(careduce_fn)

0 commit comments

Comments
 (0)