Skip to content

Commit

Permalink
Merge pull request #15 from simeonschaub/sds/fix_on_master
Browse files Browse the repository at this point in the history
introduce literal_getfield
  • Loading branch information
DhairyaLGandhi authored Dec 15, 2020
2 parents 85bfd61 + c69a717 commit 5e48881
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ZygoteRules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ export @adjoint, @adjoint!
In Zygote, differentiation of property access is defined by defining adjoint of
`ZygoteRules.literal_getproperty` rather than of `Base.getproperty`.
"""
literal_getproperty(x, ::Val{f}, getproperty=getproperty) where f = getproperty(x, f)
literal_getproperty(x, ::Val{f}) where f = getproperty(x, f)

"""
ZygoteRules.literal_getfield(x, ::Val{f})
In Zygote, differentiation of property access is defined by defining adjoint of
`ZygoteRules.literal_getfield` rather than of `Base.getfield`.
"""
literal_getfield(x, ::Val{f}) where f = getfield(x, f)

include("adjoint.jl")

Expand Down

3 comments on commit 5e48881

@simeonschaub
Copy link
Member

@simeonschaub simeonschaub commented on 5e48881 Dec 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DhairyaLGandhi Would you mind registering 0.2.1?

@DhairyaLGandhi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/26416

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 5e4888193b90fb15ccf03c0a16309c7d8c52b875
git push origin v0.2.1

Please sign in to comment.