We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f67a9b commit f96fe93Copy full SHA for f96fe93
test/optimise.jl
@@ -151,12 +151,21 @@ end
151
Flux.update!(opt, w, g)
152
@test w ≈ wold .- 0.1
153
154
+ w = randn(3)
155
+ wold = copy(w)
156
+ θ = Flux.params([w])
157
+ gs = gradient(() -> w[1], θ)
158
+ opt = Descent(0.1)
159
+ Flux.update!(opt, θ, gs)
160
+ @test w[1] ≈ wold[1] .- 0.1
161
+ @test w[2:3] ≈ wold[2:3]
162
+
163
## Issue #1550
164
w = randn(10,10)
165
wold = copy(w)
166
θ = Flux.params([w])
167
gs = gradient(() -> sum(w), θ)
168
opt = Descent(0.1)
- Flux.update!(opt, w, g)
169
170
171
end
0 commit comments