Skip to content

Commit 909310a

Browse files
committed
test adjoint
1 parent dac0557 commit 909310a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/projection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ function (project::ProjectTo{AbstractArray})(dx::AbstractArray{S,M}) where {S,M}
222222
return dz
223223
end
224224

225-
# Trivial case -- won't collapse Any[NoTangent(), NoTangent()]
225+
# Trivial case, this won't collapse Any[NoTangent(), NoTangent()] but that's OK.
226226
(project::ProjectTo{AbstractArray})(dx::AbstractArray{<:AbstractZero}) = NoTangent()
227227

228228
# Row vectors aren't acceptable as gradients for 1-row matrices:

test/projection.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ Base.zero(x::Dual) = Dual(zero(x.value), zero(x.partial))
164164
@test pvecmat(collect.(zs)) == zs
165165
@test pvecmat(collect.(zs)) isa LinearAlgebra.AdjOrTransAbsVec
166166
end
167+
168+
# issue #410
169+
@test padj([NoTangent() NoTangent() NoTangent()]) === NoTangent()
167170
end
168171

169172
@testset "LinearAlgebra: dense structured matrices" begin

0 commit comments

Comments
 (0)