File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1
1
name = " ChainRulesCore"
2
2
uuid = " d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
3
- version = " 1.12"
3
+ version = " 1.12.1 "
4
4
5
5
[deps ]
6
6
Compat = " 34da2185-b29b-5c13-b0c7-acf172513d20"
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ ProjectTo(::Any) = identity
122
122
123
123
# Thunks
124
124
(project:: ProjectTo )(dx:: Thunk ) = Thunk (project ∘ dx. f)
125
+ (project:: ProjectTo )(dx:: InplaceableThunk ) = project (dx. val)
125
126
126
127
# Zero
127
128
ProjectTo (:: AbstractZero ) = ProjectTo {NoTangent} () # Any x::Zero in forward pass makes this one projector,
Original file line number Diff line number Diff line change @@ -427,6 +427,13 @@ struct NoSuperType end
427
427
@test unthunk (pth) === 6.0 + 0.0im
428
428
end
429
429
430
+ @testset " InplaceableThunk" begin
431
+ it = InplaceableThunk (x -> x + 6 , @thunk 1 + 2 + 3 )
432
+ pt = ProjectTo (4 + 5im )(it)
433
+ @test pt isa Thunk
434
+ @test unthunk (pt) === 6.0 + 0.0im
435
+ end
436
+
430
437
@testset " Tangent" begin
431
438
x = 1 : 3.0
432
439
dx = Tangent {typeof(x)} (; step= 0.1 , ref= NoTangent ())
You can’t perform that action at this time.
0 commit comments