1
1
2
2
using ChainRules: unzip_broadcast, unzip # , unzip_map
3
3
4
- @testset " unzip_broadcast .jl" begin
4
+ @testset " unzipped .jl" begin
5
5
@testset " basics: $(sprint (show, fun)) " for fun in [unzip_broadcast, unzip∘ map, unzip∘ broadcast] # unzip_map,
6
6
@test_throws Exception fun (sqrt, 1 : 3 )
7
7
@@ -16,10 +16,8 @@ using ChainRules: unzip_broadcast, unzip #, unzip_map
16
16
else
17
17
@test fun (tuple, [1 ,2 ,3 ], [4 5 ]) == ([1 1 ; 2 2 ; 3 3 ], [4 5 ; 4 5 ; 4 5 ])
18
18
end
19
-
20
- if fun == unzip_map
21
- @test_broken fun (tuple, (1 ,2 ,3 ), (4 ,5 ,6 )) == ((1 , 2 , 3 ), (4 , 5 , 6 ))
22
- elseif fun == unzip∘ map
19
+
20
+ if fun == unzip∘ map
23
21
@test fun (tuple, (1 ,2 ,3 ), (4 ,5 ,6 )) == ((1 , 2 , 3 ), (4 , 5 , 6 ))
24
22
else
25
23
@test fun (tuple, (1 ,2 ,3 ), (4 ,5 ,6 )) == ((1 , 2 , 3 ), (4 , 5 , 6 ))
@@ -44,9 +42,9 @@ using ChainRules: unzip_broadcast, unzip #, unzip_map
44
42
@test y2 == ([1 1 ; 2 2 ; 3 3 ], [4 5 ; 4 5 ; 4 5 ], [6 6 ; 6 6 ; 6 6 ])
45
43
@test bk2 (y2)[5 ] ≈ 36
46
44
47
- y4, bk4 = rrule (CFG, unzip_map, tuple, [1 ,2 ,3.0 ], [4 ,5 ,6.0 ])
48
- @test y4 == ([1 , 2 , 3 ], [4 , 5 , 6 ])
49
- @test bk4 (([1 ,10 ,100.0 ], [7 ,8 ,9.0 ]))[3 ] ≈ [1 ,10 ,100 ]
45
+ # y4, bk4 = rrule(CFG, unzip_map, tuple, [1,2,3.0], [4,5,6.0])
46
+ # @test y4 == ([1, 2, 3], [4, 5, 6])
47
+ # @test bk4(([1,10,100.0], [7,8,9.0]))[3] ≈ [1,10,100]
50
48
end
51
49
52
50
@testset " unzip" begin
0 commit comments