Skip to content

Commit b70d614

Browse files
authored
feat: add sign dispatches (#727)
1 parent 01d2904 commit b70d614

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/TracedRNumber.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ for (jlop, hloop) in (
242242
(:(Base.asinh), :asinh),
243243
(:(Base.atan), :atan),
244244
(:(Base.atanh), :atanh),
245+
(:(Base.sign), :sign),
245246
)
246247
@eval $(jlop)(@nospecialize(lhs::TracedRNumber)) = Ops.$(hloop)(lhs)
247248
end

test/basic.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,12 @@ end
561561
end
562562
end
563563

564+
@testset "sign" begin
565+
x = collect(Float64, 0:0.01:1) .- 0.5
566+
x_ra = Reactant.to_rarray(x)
567+
@test Array(@jit(sign.(x_ra))) sign.(x)
568+
end
569+
564570
@testset "aos_to_soa" begin
565571
using ArrayInterface
566572

0 commit comments

Comments
 (0)