@@ -825,13 +825,22 @@ end
825
825
@test ! isfinite (Reactant. to_rarray (Inf ; track_numbers= Number))
826
826
end
827
827
828
- @testset " rem" begin
828
+ @testset " mod and rem" begin
829
829
a = [- 1.1 , 7.7 , - 3.3 , 9.9 , - 5.5 ]
830
830
b = [6.6 , - 2.2 , - 8.8 , 4.4 , - 10.1 ]
831
- expected = rem .(a, b)
832
- @test Reactant. @jit (rem .(Reactant. to_rarray (a), Reactant. to_rarray (b))) ≈ expected
833
- @test Reactant. @jit (rem .(a, Reactant. to_rarray (b))) ≈ expected
834
- @test Reactant. @jit (rem .(Reactant. to_rarray (a), b)) ≈ expected
831
+
832
+ # Currently broken because `mod` is JIT-ed to an HLO operator with same semantic as
833
+ # Julia's `rem`, rather than `mod`.
834
+ expected_mod = mod .(a, b)
835
+ @test_broken Reactant. @jit (mod .(Reactant. to_rarray (a), Reactant. to_rarray (b))) ≈
836
+ expected_mod
837
+ @test_broken Reactant. @jit (mod .(a, Reactant. to_rarray (b))) ≈ expected_mod
838
+ @test_broken Reactant. @jit (mod .(Reactant. to_rarray (a), b)) ≈ expected_mod
839
+
840
+ expected_rem = rem .(a, b)
841
+ @test Reactant. @jit (rem .(Reactant. to_rarray (a), Reactant. to_rarray (b))) ≈ expected_rem
842
+ @test Reactant. @jit (rem .(a, Reactant. to_rarray (b))) ≈ expected_rem
843
+ @test Reactant. @jit (rem .(Reactant. to_rarray (a), b)) ≈ expected_rem
835
844
end
836
845
837
846
@testset " reduce integers" begin
0 commit comments