Reputation: 5449
I'm trying to use Flux.jl v"0.6.10
(which I freshly installed and which looks like an awesome package) with Julia Version 1.1.0
and copied the following code from the "basic" section of the documation of flux.jl
using Flux.Tracker
f(x) = 3x^2 + 2x + 1;
df(x) = Tracker.gradient(f, x; nest = true)[1];
df(2)
However I got this error message:
ERROR: function gradient does not accept keyword arguments
Stacktrace:
[1] kwfunc(::Any) at ./boot.jl:330
[2] df(::Int64) at ./REPL[3]:1
[3] top-level scope at none:0
What am I doing wrong?
Upvotes: 1
Views: 169
Reputation: 5449
Well I just found that the version that I installed and update is the v"0.6.10
(although I just ran (v1.1) pkg> update Flux
). However in the documentation, the code above is df(x) = Tracker.gradient(f, x)[1]
for the definition of the gradient (and not df(x) = Tracker.gradient(f, x; nest = true)[1];
, which is valid for the version v"0.8.3
)
Upvotes: 0