-
Notifications
You must be signed in to change notification settings - Fork 5
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
What happens to value_and_gradient!!
if the output is not a Float64
?
#116
Comments
A non-ideal, but fairly decipherable, error. For example: rule = build_rrule(identity, randn(5))
Tapir.value_and_gradient!!(rule, identity, randn(5)) yields ERROR: AssertionError: _typeof(tangent(out)) == T
Stacktrace:
[1] value_and_pullback!!(::Tapir.DerivedRule{…}, ::Float64, ::CoDual{…}, ::CoDual{…})
@ Tapir ~/ml/ad_playground/Taped.jl/src/interface.jl:11
[2] value_and_gradient!!(::Tapir.DerivedRule{…}, ::CoDual{…}, ::CoDual{…})
@ Tapir ~/ml/ad_playground/Taped.jl/src/interface.jl:23
[3] value_and_gradient!!(::Tapir.DerivedRule{…}, ::Function, ::Vector{…})
@ Tapir ~/ml/ad_playground/Taped.jl/src/interface.jl:60
[4] top-level scope
@ REPL[38]:1
Some type information was truncated. Use `show(err)` to see complete types. |
Wouldn't it be possible to grab the type |
Provided you also constrain it to a known collection of "real-valued" types ( I'm not really testing on anything other than |
Sounds good! I was mostly curious |
Cool. Please feel free to re-open if there's anything else to chat about on this point :) |
https://github.com/withbayes/Tapir.jl/blob/f5e2b90cd17fd3127dd0fd8dfa617bc112275626/src/interface.jl#L17-L24
The text was updated successfully, but these errors were encountered: