We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0933d20 commit 3ef5ce7Copy full SHA for 3ef5ce7
pytensor/link/numba/dispatch/extra_ops.py
@@ -19,6 +19,7 @@
19
Unique,
20
UnravelIndex,
21
)
22
+from aesara.raise_op import CheckAndRaise
23
24
25
@numba_funcify.register(Bartlett)
@@ -372,3 +373,18 @@ def broadcast_to(x, *shape):
372
373
return np.broadcast_to(x, scalars_shape)
374
375
return broadcast_to
376
+
377
378
+@numba_funcify.register(CheckAndRaise)
379
+def numba_funcify_CheckAndRaise(op, node, **kwargs):
380
+ error = op.exc_type
381
+ msg = op.msg
382
383
+ @numba_basic.numba_njit
384
+ def check_and_raise(x, *conditions):
385
+ for cond in conditions:
386
+ if not cond:
387
+ raise error(msg)
388
+ return x
389
390
+ return check_and_raise
0 commit comments