Skip to content

Commit 3169a33

Browse files
committed
we can use Returns after all thanks to Compat.jl
1 parent ab61772 commit 3169a33

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/rulesets/Base/base.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
@scalar_rule copysign(y, x) (ifelse(signbit(x)!=signbit(y), -one(y), +one(y)), NoTangent())
55
@scalar_rule transpose(x) true
66

7-
# TODO: define using `Returns((NoTangent(), ZeroTangent()))` when support for Julia v1.6 is dropped
8-
function _pullback_for_constant(::Any)
9-
return (NoTangent(), ZeroTangent())
10-
end
7+
const _pullback_for_constant = Returns((NoTangent(), ZeroTangent()))
118

129
# `zero`
1310

0 commit comments

Comments
 (0)