Skip to content

Commit cdadaff

Browse files
author
Miha Zgubic
committed
comment and version number
1 parent cbe800d commit cdadaff

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Zygote"
22
uuid = "e88e6eb3-aa80-5325-afca-941959d7151f"
3-
version = "0.6.42"
3+
version = "0.6.43"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/lib/number.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ function ChainRulesCore.rrule(::ZygoteRuleConfig, ::typeof(conj), x::Number)
6161
return conj(x), conj_pullback
6262
end
6363

64+
# for real x, ChainRules pulls back a zero real adjoint, whereas we treat x
65+
# as embedded in the complex numbers and pull back a pure imaginary adjoint
6466
function ChainRulesCore.rrule(::ZygoteRuleConfig, ::typeof(imag), x::Number)
6567
imag_pullback(ī) = (NoTangent(), real(ī)*im)
6668
return imag(x), imag_pullback

0 commit comments

Comments
 (0)