@@ -71,20 +71,19 @@ using FiniteDifferences: rand_tangent
71
71
Hermitian (randn (ComplexF64, 1 , 1 )),
72
72
Tangent{Hermitian{ComplexF64, Matrix{ComplexF64}}},
73
73
),
74
- (
75
- Adjoint (randn (ComplexF64, 3 , 3 )),
76
- Tangent{Adjoint{ComplexF64, Matrix{ComplexF64}}},
77
- ),
78
- (
79
- Transpose (randn (3 )),
80
- Tangent{Transpose{Float64, Vector{Float64}}},
81
- ),
82
74
]
83
75
@test rand_tangent (rng, x) isa T_tangent
84
76
@test rand_tangent (x) isa T_tangent
85
- @test x + rand_tangent (rng, x) isa typeof (x)
86
77
end
87
78
88
- # Ensure struct fallback errors for non-struct types.
89
- @test_throws ArgumentError invoke (rand_tangent, Tuple{AbstractRNG, Any}, rng, 5.0 )
79
+ @testset " erroring cases" begin
80
+ # Ensure struct fallback errors for non-struct types.
81
+ @test_throws ArgumentError invoke (rand_tangent, Tuple{AbstractRNG, Any}, rng, 5.0 )
82
+ end
83
+
84
+ @testset " compsition of addition" begin
85
+ x = Foo (1.5 , 2 , Foo (1.1 , 3 , [1.7 , 1.4 , 0.9 ]))
86
+ @test x + rand_tangent (x) isa typeof (x)
87
+ @test x + (rand_tangent (x) + rand_tangent (x)) isa typeof (x)
88
+ end
90
89
end
0 commit comments