Skip to content

Commit cbe800d

Browse files
author
Miha Zgubic
committed
replace convert as well
1 parent c098f37 commit cbe800d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib/number.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
function ChainRulesCore.rrule(
2+
::ZygoteRuleConfig, ::typeof(convert), T::Type{<:Real}, x::Real
3+
)
4+
convert_pullback(Δ) = (NoTangent(), NoTangent(), Δ)
5+
return convert(T, x), convert_pullback
6+
end
7+
18
function ChainRulesCore.rrule(
29
::ZygoteRuleConfig, ::typeof(Base.literal_pow), ::typeof(^), x::Number, ::Val{p}
310
) where {p}

0 commit comments

Comments
 (0)