Skip to content

Commit

Permalink
added test for parent
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde authored Aug 7, 2023
1 parent 6129613 commit f0e0caf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/lib/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,13 @@ end
end
end
end

@testset "parent" begin
@testset "$constructor" for constructor in [LowerTriangular, UpperTriangular]
x = randn(2, 2)
y, pb = Zygote.pullback(x) do x
sum(parent(constructor(2 .* x)))
end
@test first(pb(one(y))) constructor(2 * ones(2, 2))
end
end

0 comments on commit f0e0caf

Please sign in to comment.