-
Notifications
You must be signed in to change notification settings - Fork 17
Test the number of outputs in frule and rrule are correct
#168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit fba43c1.
|
I've stupidly merged this before the Integration test finished. Turns out that some ChainRules tests get broken by this, so I've reverted the changes and tagged another patch version of ChainRulesTestUtils. Essentially what happens inside ChainRules is that there are some rrules for functions with optional arguments, e.g. function rrule(
::typeof(pinv),
x::AbstractVector{T},
tol::Real = 0,
) where {T<:Union{Real,Complex}}
y = pinv(x, tol)
function pinv_pullback(Δy)
∂x = sum(abs2, parent(y)) .* vec(Δy') .- 2real(y * Δy') .* parent(y)
return (NoTangent(), ∂x, ZeroTangent())
end
return y, pinv_pullback
endHere, even if |
make rand_tangent give only nice numbers
Closes #167