@@ -766,18 +766,18 @@ end
766
766
767
767
@testset " isfinite" begin
768
768
x = Reactant. to_rarray ([1.0 , NaN , Inf , - Inf , NaN ])
769
- @test Reactant . @jit (isfinite .(x)) == [true , false , false , false , false ]
769
+ @test @jit (isfinite .(x)) == [true , false , false , false , false ]
770
770
771
771
x = Reactant. to_rarray ([1.0 , NaN , Inf , - Inf , NaN ] .* im)
772
- @test Reactant . @jit (isfinite .(x)) == [true , false , false , false , false ]
772
+ @test @jit (isfinite .(x)) == [true , false , false , false , false ]
773
773
end
774
774
775
775
@testset " isnan" begin
776
776
x = Reactant. to_rarray ([1.0 , NaN , Inf , - Inf , NaN ])
777
- @test Reactant . @jit (isnan .(x)) == [false , true , false , false , true ]
777
+ @test @jit (isnan .(x)) == [false , true , false , false , true ]
778
778
779
779
x = Reactant. to_rarray ([1.0 , NaN , Inf , - Inf , NaN ] .* im)
780
- @test Reactant . @jit (isnan .(x)) == [false , true , false , false , true ]
780
+ @test @jit (isnan .(x)) == [false , true , false , false , true ]
781
781
end
782
782
783
783
@testset " isnan/isfinite" begin
@@ -787,19 +787,27 @@ end
787
787
@test ! isfinite (Reactant. to_rarray (Inf ; track_numbers= Number))
788
788
end
789
789
790
+ @testset " isinf" begin
791
+ @test Bool (@jit (isinf (ConcreteRNumber (Inf ))))
792
+ @test Bool (@jit (isinf (ConcreteRNumber (- Inf ))))
793
+ @test ! Bool (@jit (isinf (ConcreteRNumber (2 ))))
794
+ @test ! Bool (@jit (isinf (ConcreteRNumber (2.0 ))))
795
+ @test ! Bool (@jit (isinf (ConcreteRNumber (true ))))
796
+ end
797
+
790
798
@testset " mod and rem" begin
791
799
a = [- 1.1 , 7.7 , - 3.3 , 9.9 , - 5.5 ]
792
800
b = [6.6 , - 2.2 , - 8.8 , 4.4 , - 10.1 ]
793
801
794
802
expected_mod = mod .(a, b)
795
- @test Reactant . @jit (mod .(Reactant. to_rarray (a), Reactant. to_rarray (b))) ≈ expected_mod
796
- @test Reactant . @jit (mod .(a, Reactant. to_rarray (b))) ≈ expected_mod
797
- @test Reactant . @jit (mod .(Reactant. to_rarray (a), b)) ≈ expected_mod
803
+ @test @jit (mod .(Reactant. to_rarray (a), Reactant. to_rarray (b))) ≈ expected_mod
804
+ @test @jit (mod .(a, Reactant. to_rarray (b))) ≈ expected_mod
805
+ @test @jit (mod .(Reactant. to_rarray (a), b)) ≈ expected_mod
798
806
799
807
expected_rem = rem .(a, b)
800
- @test Reactant . @jit (rem .(Reactant. to_rarray (a), Reactant. to_rarray (b))) ≈ expected_rem
801
- @test Reactant . @jit (rem .(a, Reactant. to_rarray (b))) ≈ expected_rem
802
- @test Reactant . @jit (rem .(Reactant. to_rarray (a), b)) ≈ expected_rem
808
+ @test @jit (rem .(Reactant. to_rarray (a), Reactant. to_rarray (b))) ≈ expected_rem
809
+ @test @jit (rem .(a, Reactant. to_rarray (b))) ≈ expected_rem
810
+ @test @jit (rem .(Reactant. to_rarray (a), b)) ≈ expected_rem
803
811
end
804
812
805
813
@testset " xor" begin
910
918
x[:b ] = 3.1 * ones (4 )
911
919
912
920
ra = Reactant. to_rarray (x)
913
- Reactant . @jit dip! (ra)
921
+ @jit dip! (ra)
914
922
ra[:a ] ≈ (2.7 * 2 ) * ones (4 )
915
923
end
916
924
0 commit comments