|
35 | 35 | @testset "vect" begin |
36 | 36 | test_rrule(Base.vect) |
37 | 37 | @testset "homogeneous type" begin |
38 | | - test_rrule(Base.vect, (5.0, ), (4.0, )) |
| 38 | + test_rrule(Base.vect, (5.0,), (4.0,)) |
| 39 | + test_frule(Base.vect, (5.0,), (4.0,)) |
39 | 40 | test_rrule(Base.vect, 5.0, 4.0, 3.0) |
| 41 | + test_frule(Base.vect, 5.0, 4.0, 3.0) |
40 | 42 | test_rrule(Base.vect, randn(2, 2), randn(3, 3)) |
| 43 | + test_frule(Base.vect, randn(2, 2), randn(3, 3)) |
| 44 | + |
| 45 | + # Nonnumber types |
| 46 | + test_frule(Base.vect, (1.0, 2.0), (1.0, 2.0)) |
| 47 | + test_rrule(Base.vect, (1.0, 2.0), (1.0, 2.0)) |
41 | 48 | end |
42 | 49 | @testset "inhomogeneous type" begin |
43 | 50 | # fwd |
|
52 | 59 | end |
53 | 60 | @testset "_instantiate_zeros" begin |
54 | 61 | # This is an internal function also used for `cat` etc. |
55 | | - @eval using ChainRules: _instantiate_zeros |
| 62 | + _instantiate_zeros = ChainRules._instantiate_zeros |
56 | 63 | # Check these hit the fast path, unrealistic input so that map would fail: |
57 | 64 | @test _instantiate_zeros((true, 2 , 3.0), ()) == (1, 2, 3) |
58 | 65 | @test _instantiate_zeros((1:2, [3, 4]), ()) == (1:2, 3:4) |
|
0 commit comments