Skip to content

Commit

Permalink
Replace Zygote.@nograd with CRC.@non_differentiable (#230)
Browse files Browse the repository at this point in the history
* Replace `Zygote.@nograd` with `CRC.@non_differentiable`

* Update Project.toml

Co-authored-by: Hong Ge <[email protected]>
  • Loading branch information
devmotion and yebai authored Aug 23, 2022
1 parent 38c46cf commit 95c54fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Bijectors"
uuid = "76274a88-744f-5084-9051-94815aaf08c4"
version = "0.10.4"
version = "0.10.5"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
3 changes: 3 additions & 0 deletions src/chainrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,6 @@ function ChainRulesCore.rrule(::typeof(_transform_inverse_ordered), x::AbstractM

return y, _transform_inverse_ordered_adjoint
end

# Fixes Zygote's issues with `@debug`
ChainRulesCore.@non_differentiable _debug(::Any)
3 changes: 1 addition & 2 deletions src/compat/zygote.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using .Zygote: Zygote, @adjoint, @nograd, pullback
using .Zygote: Zygote, @adjoint, pullback

using Compat: eachcol

@adjoint istraining() = true, _ -> nothing
@nograd Bijectors._debug

@adjoint function mapvcat(f, args...)
g(f, args...) = map(f, args...)
Expand Down

2 comments on commit 95c54fa

@devmotion
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/66885

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.10.5 -m "<description of version>" 95c54fac7205a64e96ea9445e082e4b7cbff278d
git push origin v0.10.5

Please sign in to comment.