@@ -371,26 +371,26 @@ end
371
371
372
372
@testset " Number and RArray" for a in [1.0f0 , 1.0e0 ]
373
373
typeof_a = typeof (a)
374
- _b = [2.0 , 3.0 , 4.0 ] .| > typeof_a
375
- _c = [2.0 3.0 4.0 ] .| > typeof_a
374
+ _b = typeof_a .( [2.0 , 3.0 , 4.0 ])
375
+ _c = typeof_a .( [2.0 3.0 4.0 ])
376
376
b = Reactant. to_rarray (_b)
377
377
c = Reactant. to_rarray (_c)
378
-
378
+
379
379
# vcat test
380
380
y = @jit vcat (a, b)
381
381
@test y == vcat (a, _b)
382
382
@test y isa ConcreteRArray{typeof_a,1 }
383
-
383
+
384
384
# # vcat test - adjoint
385
385
y1 = @jit vcat (a, c' )
386
386
@test y1 == vcat (a, _c' )
387
387
@test y1 isa ConcreteRArray{typeof_a,2 }
388
-
388
+
389
389
# hcat test
390
390
z = @jit hcat (a, c)
391
391
@test z == hcat (a, _c)
392
392
@test z isa ConcreteRArray{typeof_a,2 }
393
-
393
+
394
394
# # hcat test - adjoint
395
395
z1 = @jit hcat (a, b' )
396
396
@test z1 == hcat (a, _b' )
@@ -1028,3 +1028,19 @@ end
1028
1028
@test res[2 ] isa ConcreteRNumber{Float32}
1029
1029
end
1030
1030
end
1031
+
1032
+ @testset " isfinite" begin
1033
+ x = Reactant. to_rarray ([1.0 , NaN , Inf , - Inf , NaN ])
1034
+ @test Reactant. @jit (isfinite .(x)) == [true , false , false , false , false ]
1035
+
1036
+ x = Reactant. to_rarray ([1.0 , NaN , Inf , - Inf , NaN ] .* im)
1037
+ @test Reactant. @jit (isfinite .(x)) == [true , false , false , false , false ]
1038
+ end
1039
+
1040
+ @testset " isnan" begin
1041
+ x = Reactant. to_rarray ([1.0 , NaN , Inf , - Inf , NaN ])
1042
+ @test Reactant. @jit (isnan .(x)) == [false , true , false , false , true ]
1043
+
1044
+ x = Reactant. to_rarray ([1.0 , NaN , Inf , - Inf , NaN ] .* im)
1045
+ @test Reactant. @jit (isnan .(x)) == [false , true , false , false , true ]
1046
+ end
0 commit comments