@@ -171,16 +171,16 @@ end
171
171
@testset " cosine" begin
172
172
# it crashes in apple x86_64 and it's a deprecated platform so we don't need to care a lot...
173
173
x = Reactant. to_rarray ([0 , π / 2 , π, 3 π / 2 , 2 π])
174
- @test [1 , 0 , - 1 , 0 , 1 ] ≈ @jit Ops. cosine (x) broken = RunningOnAppleX86
174
+ @test [1 , 0 , - 1 , 0 , 1 ] ≈ @jit ( Ops. cosine (x) ) broken = RunningOnAppleX86
175
175
176
176
x = Reactant. to_rarray ([0.0 , π / 2 , π, 3 π / 2 , 2 π])
177
- @test [1.0 , 0.0 , - 1.0 , 0.0 , 1.0 ] ≈ @jit Ops. cosine (x) broken = RunningOnAppleX86
177
+ @test [1.0 , 0.0 , - 1.0 , 0.0 , 1.0 ] ≈ @jit ( Ops. cosine (x) ) broken = RunningOnAppleX86
178
178
179
179
x = Reactant. to_rarray ([
180
180
0.0 + 0.0im , π / 2 + 0.0im , π + 0.0im , 3 π / 2 + 0.0im , 2 π + 0.0im
181
181
])
182
182
@test [1.0 + 0.0im , 0.0 + 0.0im , - 1.0 + 0.0im , 0.0 + 0.0im , 1.0 + 0.0im ] ≈
183
- @jit Ops. cosine (x) broken = RunningOnTPU || RunningOnAppleX86
183
+ @jit ( Ops. cosine (x) ) broken = RunningOnTPU || RunningOnAppleX86
184
184
end
185
185
186
186
@testset " count_leading_zeros" begin
240
240
241
241
a = Reactant. to_rarray ([1 2 ; 3 4 ])
242
242
b = Reactant. to_rarray ([5 6 ; - 7 - 8 ])
243
- @test Array (a)' * Array (b) == @jit f1 (a, b) broken = RunningOnTPU
243
+ @test Array (a)' * Array (b) == @jit ( f1 (a, b) ) broken = RunningOnTPU
244
244
end
245
245
246
246
@testset " exponential" begin
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
251
@test exp .(Array (x)) ≈
252
- @jit Ops. exponential (x) broken = RunningOnTPU || RunningOnAppleX86
252
+ @jit ( Ops. exponential (x) ) broken = RunningOnTPU || RunningOnAppleX86
253
253
end
254
254
255
255
@testset " exponential_minus_one" begin
@@ -258,30 +258,30 @@ end
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
260
@test expm1 .(Array (x)) ≈
261
- @jit Ops. exponential_minus_one (x) broken = RunningOnTPU || RunningOnAppleX86
261
+ @jit ( Ops. exponential_minus_one (x) ) broken = RunningOnTPU || RunningOnAppleX86
262
262
end
263
263
264
264
@testset " fft" begin
265
265
grfft (x) = Ops. fft (x; type= " RFFT" , length= [4 ])
266
266
gfft (x) = Ops. fft (x; type= " FFT" , length= [4 ])
267
267
268
268
x = Reactant. to_rarray ([1.0 , 1.0 , 1.0 , 1.0 ])
269
- @test ComplexF64[4.0 , 0.0 , 0.0 ] ≈ @jit grfft (x) broken = RunningOnTPU
269
+ @test ComplexF64[4.0 , 0.0 , 0.0 ] ≈ @jit ( grfft (x) ) broken = RunningOnTPU
270
270
271
271
x = Reactant. to_rarray ([0.0 , 1.0 , 0.0 , - 1.0 ])
272
- @test ComplexF64[0.0 , - 2.0im , 0.0 ] ≈ @jit grfft (x) broken = RunningOnTPU
272
+ @test ComplexF64[0.0 , - 2.0im , 0.0 ] ≈ @jit ( grfft (x) ) broken = RunningOnTPU
273
273
274
274
x = Reactant. to_rarray ([1.0 , - 1.0 , 1.0 , - 1.0 ])
275
- @test ComplexF64[0.0 , 0.0 , 4.0 ] ≈ @jit grfft (x) broken = RunningOnTPU
275
+ @test ComplexF64[0.0 , 0.0 , 4.0 ] ≈ @jit ( grfft (x) ) broken = RunningOnTPU
276
276
277
277
x = Reactant. to_rarray (ComplexF64[1.0 , 1.0 , 1.0 , 1.0 ])
278
- @test ComplexF64[4.0 , 0.0 , 0.0 , 0.0 ] ≈ @jit gfft (x) broken = RunningOnTPU
278
+ @test ComplexF64[4.0 , 0.0 , 0.0 , 0.0 ] ≈ @jit ( gfft (x) ) broken = RunningOnTPU
279
279
280
280
x = Reactant. to_rarray (ComplexF64[0.0 , 1.0 , 0.0 , - 1.0 ])
281
- @test ComplexF64[0.0 , - 2.0im , 0.0 , 2.0im ] ≈ @jit gfft (x) broken = RunningOnTPU
281
+ @test ComplexF64[0.0 , - 2.0im , 0.0 , 2.0im ] ≈ @jit ( gfft (x) ) broken = RunningOnTPU
282
282
283
283
x = Reactant. to_rarray (ComplexF64[1.0 , - 1.0 , 1.0 , - 1.0 ])
284
- @test ComplexF64[0.0 , 0.0 , 4.0 , 0.0 ] ≈ @jit gfft (x) broken = RunningOnTPU
284
+ @test ComplexF64[0.0 , 0.0 , 4.0 , 0.0 ] ≈ @jit ( gfft (x) ) broken = RunningOnTPU
285
285
286
286
# TODO test with complex numbers and inverse FFT
287
287
end
305
305
306
306
@testset " imag" begin
307
307
x = Reactant. to_rarray ([1.1 + 2.2im , 3.3 + 4.4im , 5.5 + 6.6im , 7.7 + 8.8im ])
308
- @test [2.2 , 4.4 , 6.6 , 8.8 ] ≈ @jit Ops. imag (x) broken = RunningOnTPU
308
+ @test [2.2 , 4.4 , 6.6 , 8.8 ] ≈ @jit ( Ops. imag (x) ) broken = RunningOnTPU
309
309
end
310
310
311
311
@testset " iota" begin
@@ -336,15 +336,15 @@ end
336
336
@test log .(Array (x)) ≈ @jit Ops. log (x)
337
337
338
338
x = Reactant. to_rarray ([1.0 + 0.0im , 2.0 + 0.0im , - 3.0 + 0.0im , - 4.0 + 0.0im ])
339
- @test log .(Array (x)) ≈ @jit Ops. log (x) broken = RunningOnTPU
339
+ @test log .(Array (x)) ≈ @jit ( Ops. log (x) ) broken = RunningOnTPU
340
340
end
341
341
342
342
@testset " log_plus_one" begin
343
343
x = Reactant. to_rarray ([1.0 , 2.0 , 3.0 , 4.0 ])
344
344
@test log .(Array (x)) ≈ @jit Ops. log (x)
345
345
346
346
x = Reactant. to_rarray ([1.0 + 0.0im , 2.0 + 0.0im , - 3.0 + 0.0im , - 4.0 + 0.0im ])
347
- @test log .(Array (x)) ≈ @jit Ops. log (x) broken = RunningOnTPU
347
+ @test log .(Array (x)) ≈ @jit ( Ops. log (x) ) broken = RunningOnTPU
348
348
end
349
349
350
350
@testset " logistic" begin
417
417
418
418
x = Reactant. to_rarray ([- 1.0 + 2im , 0.0 - 3im , 1.0 + 4im , 10.0 - 5im ])
419
419
@test [1.0 - 2im , 0.0 + 3im , - 1.0 - 4im , - 10.0 + 5im ] ≈
420
- @jit Ops. negate (x) broken = RunningOnTPU
420
+ @jit ( Ops. negate (x) ) broken = RunningOnTPU
421
421
end
422
422
423
423
@testset " not" begin
@@ -490,12 +490,12 @@ end
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
492
@test Array (x) .^ Array (p) ≈
493
- @jit Ops. power (x, p) broken = RunningOnTPU || RunningOnAppleX86
493
+ @jit ( Ops. power (x, p) ) broken = RunningOnTPU || RunningOnAppleX86
494
494
end
495
495
496
496
@testset " real" begin
497
497
x = Reactant. to_rarray ([1.1 + 2.2im , 3.3 + 4.4im , 5.5 + 6.6im , 7.7 + 8.8im ])
498
- @test [1.1 , 3.3 , 5.5 , 7.7 ] ≈ @jit Ops. real (x) broken = RunningOnTPU
498
+ @test [1.1 , 3.3 , 5.5 , 7.7 ] ≈ @jit ( Ops. real (x) ) broken = RunningOnTPU
499
499
end
500
500
501
501
@testset " recv" begin end
608
608
609
609
x = Reactant. to_rarray ([1.0 + 1im 4.0 + 2im ; 9.0 + 3im 25.0 + 4im ])
610
610
@test 1 ./ sqrt .(Array (x)) ≈
611
- @jit Ops. rsqrt (x) broken = RunningOnTPU || RunningOnAppleX86
611
+ @jit ( Ops. rsqrt (x) ) broken = RunningOnTPU || RunningOnAppleX86
612
612
end
613
613
614
614
@testset " select" begin
@@ -681,16 +681,16 @@ end
681
681
682
682
@testset " sine" begin
683
683
x = Reactant. to_rarray ([0 , π / 2 , π, 3 π / 2 , 2 π])
684
- @test [0 , 1 , 0 , - 1 , 0 ] ≈ @jit Ops. sine (x) broken = RunningOnAppleX86
684
+ @test [0 , 1 , 0 , - 1 , 0 ] ≈ @jit ( Ops. sine (x) ) broken = RunningOnAppleX86
685
685
686
686
x = Reactant. to_rarray ([0.0 , π / 2 , π, 3 π / 2 , 2 π])
687
- @test [0.0 , 1.0 , 0.0 , - 1.0 , 0.0 ] ≈ @jit Ops. sine (x) broken = RunningOnTPU
687
+ @test [0.0 , 1.0 , 0.0 , - 1.0 , 0.0 ] ≈ @jit ( Ops. sine (x) ) broken = RunningOnTPU
688
688
689
689
x = Reactant. to_rarray ([
690
690
0.0 + 0.0im , π / 2 + 0.0im , π + 0.0im , 3 π / 2 + 0.0im , 2 π + 0.0im
691
691
])
692
692
@test [0.0 + 0.0im , 1.0 + 0.0im , 0.0 + 0.0im , - 1.0 + 0.0im , 0.0 + 0.0im ] ≈
693
- @jit Ops. sine (x) broken = RunningOnTPU || RunningOnAppleX86
693
+ @jit ( Ops. sine (x) ) broken = RunningOnTPU || RunningOnAppleX86
694
694
end
695
695
696
696
@testset " sort" begin
718
718
719
719
x = Reactant. to_rarray ([1.0 + 0im , 0.0 + 1im ])
720
720
@test [1.0 + 0im , 1 / √ 2 * (1 + im)] ≈
721
- @jit Ops. sqrt (x) broken = RunningOnTPU || RunningOnAppleX86
721
+ @jit ( Ops. sqrt (x) ) broken = RunningOnTPU || RunningOnAppleX86
722
722
end
723
723
724
724
@testset " subtract" begin
@@ -744,13 +744,13 @@ end
744
744
x = Reactant. to_rarray ([0 , π / 4 , π / 2 , 3 π / 4 , π])
745
745
746
746
@test [0.0 , 1.0 , 1.633123935319537e16 , - 1.0 , 0.0 ] ≈
747
- @jit Ops. tan (x) broken = RunningOnTPU || RunningOnAppleX86
747
+ @jit ( Ops. tan (x) ) broken = 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
752
@test ComplexF64[0.0 , 1.0 , 1.633123935319537e16 , - 1.0 , 0.0 ] ≈
753
- @jit Ops. tan (x) broken = RunningOnTPU || RunningOnAppleX86
753
+ @jit ( Ops. tan (x) ) broken = RunningOnTPU || RunningOnAppleX86
754
754
end
755
755
756
756
@testset " tanh" begin
759
759
760
760
x = Reactant. to_rarray (ComplexF64[- 1.0 , 0.0 , 1.0 ])
761
761
@test ComplexF64[- 0.7615941559557649 , 0.0 , 0.7615941559557649 ] ≈
762
- @jit Ops. tanh (x) broken = RunningOnTPU || RunningOnAppleX86
762
+ @jit ( Ops. tanh (x) ) broken = RunningOnTPU || RunningOnAppleX86
763
763
end
764
764
765
765
@testset " transpose" begin
837
837
838
838
@testset " conj" begin
839
839
x = Reactant. to_rarray ([- 1.0 + 2im , 0.0 - 1im , 1.0 + 4im ])
840
- @test conj (Array (x)) ≈ @jit Ops. conj (x) broken = RunningOnTPU
840
+ @test conj (Array (x)) ≈ @jit ( Ops. conj (x) ) broken = RunningOnTPU
841
841
end
842
842
843
843
@testset " cosh" begin
886
886
@testset " lgamma" begin
887
887
x = Reactant. to_rarray ([- 1.0 , 0.0 , 1.0 , 2.5 ])
888
888
lgamma (x) = (SpecialFunctions. logabsgamma (x))[1 ]
889
- @test lgamma .(Array (x)) ≈ @jit Ops. lgamma (x) broken = RunningOnTPU || RunningOnAppleX86
889
+ @test lgamma .(Array (x)) ≈ @jit ( Ops. lgamma (x) ) broken = RunningOnTPU || RunningOnAppleX86
890
890
end
891
891
892
892
@testset " next_after" begin
@@ -902,14 +902,14 @@ end
902
902
nextfloat (1e18 ),
903
903
prevfloat (3e-9 ),
904
904
nextfloat (3e-9 ),
905
- ] == @jit Ops. next_after (x, y) broken = RunningOnTPU
905
+ ] == @jit ( Ops. next_after (x, y) ) broken = RunningOnTPU
906
906
end
907
907
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
911
@test SpecialFunctions. polygamma .(Int .(Array (m)), Array (x)) ≈
912
- @jit Ops. polygamma (m, x) broken = RunningOnAppleX86
912
+ @jit ( Ops. polygamma (m, x) ) broken = RunningOnAppleX86
913
913
end
914
914
915
915
@testset " sinh" begin
0 commit comments