File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 11name = " FiniteDifferences"
22uuid = " 26cc04aa-876d-5657-8c51-4c34ba976000"
3- version = " 0.12.23 "
3+ version = " 0.12.24 "
44
55[deps ]
66ChainRulesCore = " d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Original file line number Diff line number Diff line change @@ -287,3 +287,14 @@ function FiniteDifferences.to_vec(t::Thunk)
287287 Thunk_from_vec = v -> @thunk (back (v))
288288 return v, Thunk_from_vec
289289end
290+
291+ function FiniteDifferences. to_vec (t:: InplaceableThunk )
292+ v, back = to_vec (unthunk (t))
293+ function InplaceableThunk_from_vec (v)
294+ return InplaceableThunk (
295+ Δ -> Δ += back (b),
296+ @thunk (back (v))
297+ )
298+ end
299+ return v, InplaceableThunk_from_vec
300+ end
Original file line number Diff line number Diff line change 249249 end
250250
251251 @testset " Thunks" begin
252- test_to_vec (@thunk (3.2 + 4.3 ))
252+ t = @thunk (3.2 + 4.3 )
253+ test_to_vec (t)
254+ test_to_vec (InplaceableThunk (Δ -> Δ += t, t))
253255 end
254256 end
255257
You can’t perform that action at this time.
0 commit comments