We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a3ca7c1 + 9ccd7c8 commit 7367cc1Copy full SHA for 7367cc1
src/compat/chainrulescore.jl
@@ -1,6 +1,6 @@
1
function ChainRulesCore.rrule(::typeof(getproperty), x::ComponentArray, s::Union{Symbol, Val})
2
function getproperty_adjoint(Δ)
3
- zero_x = ComponentArray(zeros(eltype(Δ), size(x)), getaxes(x))
+ zero_x = zero(similar(x, eltype(Δ)))
4
setproperty!(zero_x, s, Δ)
5
return (ChainRulesCore.NoTangent(), zero_x, ChainRulesCore.NoTangent())
6
end
0 commit comments