@@ -248,17 +248,17 @@ end
248
248
@test exp .(Array (x)) ≈ @jit Ops. exponential (x)
249
249
250
250
x = Reactant. to_rarray ([1.0 + 2.0im , 3.0 + 4.0im , 5.0 + 6.0im , 7.0 + 8.0im ])
251
- @test exp .(Array (x)) ≈
252
- @jit (Ops . exponential (x)) broken = RunningOnTPU || RunningOnAppleX86
251
+ @test exp .(Array (x)) ≈ @jit (Ops . exponential (x)) broken =
252
+ RunningOnTPU || RunningOnAppleX86
253
253
end
254
254
255
255
@testset " exponential_minus_one" begin
256
256
x = Reactant. to_rarray ([1.0 , 2.0 , 3.0 , 4.0 ])
257
257
@test expm1 .(Array (x)) ≈ @jit Ops. exponential_minus_one (x)
258
258
259
259
x = Reactant. to_rarray ([1.0 + 2.0im , 3.0 + 4.0im , 5.0 + 6.0im , 7.0 + 8.0im ])
260
- @test expm1 .(Array (x)) ≈
261
- @jit (Ops . exponential_minus_one (x)) broken = RunningOnTPU || RunningOnAppleX86
260
+ @test expm1 .(Array (x)) ≈ @jit (Ops . exponential_minus_one (x)) broken =
261
+ RunningOnTPU || RunningOnAppleX86
262
262
end
263
263
264
264
@testset " fft" begin
416
416
@test [1.0 , 0.0 , - 1.0 , - 10.0 ] ≈ @jit Ops. negate (x)
417
417
418
418
x = Reactant. to_rarray ([- 1.0 + 2im , 0.0 - 3im , 1.0 + 4im , 10.0 - 5im ])
419
- @test [1.0 - 2im , 0.0 + 3im , - 1.0 - 4im , - 10.0 + 5im ] ≈
420
- @jit (Ops . negate (x)) broken = RunningOnTPU
419
+ @test [1.0 - 2im , 0.0 + 3im , - 1.0 - 4im , - 10.0 + 5im ] ≈ @jit (Ops . negate (x)) broken =
420
+ RunningOnTPU
421
421
end
422
422
423
423
@testset " not" begin
489
489
490
490
x = Reactant. to_rarray ([0.0 + 1.0im , 0.0 + 1.0im , 0.0 + 1.0im , 0.0 + 1.0im ])
491
491
p = Reactant. to_rarray ([0.0 + 0.0im , 1.0 + 0.0im , 2.0 + 0.0im , 3.0 + 0.0im ])
492
- @test Array (x) .^ Array (p) ≈
493
- @jit (Ops . power (x, p)) broken = RunningOnTPU || RunningOnAppleX86
492
+ @test Array (x) .^ Array (p) ≈ @jit (Ops . power (x, p)) broken =
493
+ RunningOnTPU || RunningOnAppleX86
494
494
end
495
495
496
496
@testset " real" begin
607
607
@test 1 ./ sqrt .(Array (x)) ≈ @jit Ops. rsqrt (x)
608
608
609
609
x = Reactant. to_rarray ([1.0 + 1im 4.0 + 2im ; 9.0 + 3im 25.0 + 4im ])
610
- @test 1 ./ sqrt .(Array (x)) ≈
611
- @jit (Ops . rsqrt (x)) broken = RunningOnTPU || RunningOnAppleX86
610
+ @test 1 ./ sqrt .(Array (x)) ≈ @jit (Ops . rsqrt (x)) broken =
611
+ RunningOnTPU || RunningOnAppleX86
612
612
end
613
613
614
614
@testset " select" begin
717
717
@test [1.0 , 2.0 , 3.0 , 4.0 ] ≈ @jit Ops. sqrt (x)
718
718
719
719
x = Reactant. to_rarray ([1.0 + 0im , 0.0 + 1im ])
720
- @test [1.0 + 0im , 1 / √ 2 * (1 + im)] ≈
721
- @jit (Ops . sqrt (x)) broken = RunningOnTPU || RunningOnAppleX86
720
+ @test [1.0 + 0im , 1 / √ 2 * (1 + im)] ≈ @jit (Ops . sqrt (x)) broken =
721
+ RunningOnTPU || RunningOnAppleX86
722
722
end
723
723
724
724
@testset " subtract" begin
@@ -743,23 +743,23 @@ end
743
743
# TODO tan(π/2) is Inf but it returns 1.633123935319537e16
744
744
x = Reactant. to_rarray ([0 , π / 4 , π / 2 , 3 π / 4 , π])
745
745
746
- @test [0.0 , 1.0 , 1.633123935319537e16 , - 1.0 , 0.0 ] ≈
747
- @jit (Ops . tan (x)) broken = RunningOnTPU || RunningOnAppleX86
746
+ @test [0.0 , 1.0 , 1.633123935319537e16 , - 1.0 , 0.0 ] ≈ @jit (Ops . tan (x)) broken =
747
+ RunningOnTPU || RunningOnAppleX86
748
748
749
749
x = Reactant. to_rarray ([
750
750
0.0 + 0.0im , π / 4 + 0.0im , π / 2 + 0.0im , 3 π / 4 + 0.0im , π + 0.0im
751
751
])
752
- @test ComplexF64[0.0 , 1.0 , 1.633123935319537e16 , - 1.0 , 0.0 ] ≈
753
- @jit (Ops . tan (x)) broken = RunningOnTPU || RunningOnAppleX86
752
+ @test ComplexF64[0.0 , 1.0 , 1.633123935319537e16 , - 1.0 , 0.0 ] ≈ @jit (Ops . tan (x)) broken =
753
+ RunningOnTPU || RunningOnAppleX86
754
754
end
755
755
756
756
@testset " tanh" begin
757
757
x = Reactant. to_rarray ([- 1.0 , 0.0 , 1.0 ])
758
758
@test [- 0.7615941559557649 , 0.0 , 0.7615941559557649 ] ≈ @jit Ops. tanh (x)
759
759
760
760
x = Reactant. to_rarray (ComplexF64[- 1.0 , 0.0 , 1.0 ])
761
- @test ComplexF64[- 0.7615941559557649 , 0.0 , 0.7615941559557649 ] ≈
762
- @jit (Ops . tanh (x)) broken = RunningOnTPU || RunningOnAppleX86
761
+ @test ComplexF64[- 0.7615941559557649 , 0.0 , 0.7615941559557649 ] ≈ @jit (Ops . tanh (x)) broken =
762
+ RunningOnTPU || RunningOnAppleX86
763
763
end
764
764
765
765
@testset " transpose" begin
908
908
@testset " polygamma" begin
909
909
x = Reactant. to_rarray ([- 1.0 , 0.0 , 1.0 , 1.0 , 2.5 ])
910
910
m = Reactant. to_rarray ([3.0 , 3.0 , 2.0 , 3.0 , 4.0 ])
911
- @test SpecialFunctions. polygamma .(Int .(Array (m)), Array (x)) ≈
912
- @jit (Ops . polygamma (m, x)) broken = RunningOnAppleX86
911
+ @test SpecialFunctions. polygamma .(Int .(Array (m)), Array (x)) ≈ @jit (Ops . polygamma (m, x)) broken =
912
+ RunningOnAppleX86
913
913
end
914
914
915
915
@testset " sinh" begin
0 commit comments