@@ -75,6 +75,7 @@ def scipy_special_gammal(k, x):
75
75
expected_i0 = scipy .special .i0
76
76
expected_i1 = scipy .special .i1
77
77
expected_iv = scipy .special .iv
78
+ expected_ive = scipy .special .ive
78
79
expected_erfcx = scipy .special .erfcx
79
80
expected_sigmoid = scipy .special .expit
80
81
expected_hyp2f1 = scipy .special .hyp2f1
@@ -639,6 +640,23 @@ def fixed_first_input_jv(x):
639
640
inplace = True ,
640
641
)
641
642
643
+ TestIveBroadcast = makeBroadcastTester (
644
+ op = at .ive ,
645
+ expected = expected_ive ,
646
+ good = _good_broadcast_binary_bessel ,
647
+ eps = 2e-10 ,
648
+ mode = mode_no_scipy ,
649
+ )
650
+
651
+ TestIveInplaceBroadcast = makeBroadcastTester (
652
+ op = inplace .ive_inplace ,
653
+ expected = expected_ive ,
654
+ good = _good_broadcast_binary_bessel ,
655
+ eps = 2e-10 ,
656
+ mode = mode_no_scipy ,
657
+ inplace = True ,
658
+ )
659
+
642
660
643
661
def test_verify_iv_grad ():
644
662
# Verify Iv gradient.
@@ -652,6 +670,18 @@ def fixed_first_input_iv(x):
652
670
utt .verify_grad (fixed_first_input_iv , [x_val ])
653
671
654
672
673
+ def test_verify_ive_grad ():
674
+ # Verify Ive gradient.
675
+ # Implemented separately due to need to fix first input for which grad is
676
+ # not defined.
677
+ v_val , x_val = _grad_broadcast_binary_bessel ["normal" ]
678
+
679
+ def fixed_first_input_ive (x ):
680
+ return at .ive (v_val , x )
681
+
682
+ utt .verify_grad (fixed_first_input_ive , [x_val ])
683
+
684
+
655
685
TestSigmoidBroadcast = makeBroadcastTester (
656
686
op = at .sigmoid ,
657
687
expected = expected_sigmoid ,
0 commit comments