This commit is contained in:
Mike Innes 2018-07-30 16:32:43 +01:00 committed by Mike J Innes
parent a50432324b
commit 4cf6bac0c1

View File

@ -87,7 +87,7 @@ Hook into gradient backpropagation. `x` is unmodified, but when backpropagating
the sign of the gradient applied to `x`.
"""
hook(f, x) = istracked(x) ? track(hook, f, x) : x
@grad hook(f, x) = x, Δ -> (nothing, f(Δ))
@grad hook(f, x) = data(x), Δ -> (nothing, f(Δ))
"""
checkpoint(f, args...)