Skip to content
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

gradient(f,args...) not update when rewriting function #27

Closed
johnnychen94 opened this issue Oct 17, 2018 · 2 comments
Closed

gradient(f,args...) not update when rewriting function #27

johnnychen94 opened this issue Oct 17, 2018 · 2 comments

Comments

@johnnychen94
Copy link
Contributor

julia> using Zygote
[ Info: Precompiling Zygote [e88e6eb3-aa80-5325-afca-941959d7151f]

julia> f(x) = 2x + 3
f (generic function with 1 method)

julia> Zygote.gradient(f,0)
(2,)

julia> f(x) = 0
f (generic function with 1 method)

julia> Zygote.gradient(f,0) # should be 0
(2,)
@johnnychen94 johnnychen94 changed the title gradient not work when rewriting function definition gradient(f,args...) not update when rewriting function Oct 17, 2018
@chriselrod
Copy link

chriselrod commented Oct 17, 2018

Duplicate of #22

Use Zygote.refresh().

@johnnychen94
Copy link
Contributor Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants