@@ -182,15 +182,21 @@ end
182182# ===================================
183183
184184@testset " normalize" begin
185- @testset " x::Vector {$T }" for T in (Float64, ComplexF64)
185+ @testset " x::Array {$T }" for T in (Float64, ComplexF64)
186186 x = randn (T, 3 )
187187 test_rrule (normalize, x)
188188 @test rrule (normalize, x)[2 ](ZeroTangent ()) === (NoTangent (), ZeroTangent ())
189+
190+ test_rrule (normalize, rand (T, 3 , 4 ))
191+ test_rrule (normalize, adjoint (rand (T, 5 )))
189192 end
190- @testset " x::Vector {$T }, p=$p " for T in (Float64, ComplexF64),
191- p in ( 1.0 , 2.0 , - Inf , Inf , 2.5 ) # skip p=0, since FD is unstable
193+ @testset " x::Array {$T }, p=$p " for T in (Float64, ComplexF64), p in ( 1.0 , 2.0 , - Inf , Inf , 2.5 )
194+ # skip p=0, since FD is unstable
192195 x = randn (T, 3 )
193196 test_rrule (normalize, x, p)
194197 @test rrule (normalize, x, p)[2 ](ZeroTangent ()) === (NoTangent (), ZeroTangent (), ZeroTangent ())
198+
199+ test_rrule (normalize, rand (T, 3 , 4 ), p)
200+ test_rrule (normalize, adjoint (rand (T, 5 )), p)
195201 end
196202end
0 commit comments