Skip to content

Commit

Permalink
use ZeroTangent for derivative of zero and one (#726)
Browse files Browse the repository at this point in the history
* use ZeroTangent for derivative of zero and one

* bump version

* fix typo
  • Loading branch information
oxinabox authored Jul 14, 2023
1 parent 34aec33 commit df672c3
Show file tree
Hide file tree
Showing 2 changed files with 3 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 = "ChainRules"
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
version = "1.52.1"
version = "1.53.0"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
4 changes: 2 additions & 2 deletions src/rulesets/Base/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

@scalar_rule copysign(y, x) (ifelse(signbit(x)!=signbit(y), -one(y), +one(y)), NoTangent())

@scalar_rule one(x) zero(x)
@scalar_rule zero(x) zero(x)
@scalar_rule one(x) ZeroTangent()
@scalar_rule zero(x) ZeroTangent()
@scalar_rule transpose(x) true

# `adjoint`
Expand Down

2 comments on commit df672c3

@oxinabox
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/87495

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 v1.53.0 -m "<description of version>" df672c3b86aed6ec2638f9e56e279c26ebe92828
git push origin v1.53.0

Please sign in to comment.