File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 11
11
@test ChainRules. _update! (X, Diagonal ([1 , 1 ])) == [2 2 ; 3 5 ]
12
12
@test X != Y # X has been updated
13
13
end
14
-
15
14
@testset " _update! Zero" begin
16
15
X = [1 2 ; 3 4 ]
17
16
@test ChainRules. _update! (X, Zero ()) === X
18
17
@test ChainRules. _update! (Zero (), X) === X
19
18
@test ChainRules. _update! (Zero (), Zero ()) === Zero ()
20
-
19
+ end
20
+ @testset " _update! NamedTuple" begin
21
21
X = (A= [1 0 ; 0 1 ], B= [2 2 ; 2 2 ])
22
22
Y = deepcopy (X)
23
23
@test ChainRules. _update! (X, Y) == (A= [2 0 ; 0 2 ], B= [4 4 ; 4 4 ])
24
24
@test X. A != Y. A
25
25
@test X. B != Y. B
26
26
end
27
-
28
27
@testset " _checked_rrule" begin
29
28
try
30
- @eval cool (x,y)= x + y
29
+ @eval cool (x,y) = x + y
31
30
# We defined a 2-arg method for `cool` but no `rrule`
32
31
ChainRules. _checked_rrule (cool, 1.0 , 2.0 )
33
32
catch e
You can’t perform that action at this time.
0 commit comments