Skip to content

Commit

Permalink
Improved PositiveDefinite test code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaskl97 committed Jan 30, 2025
1 parent 5c6888b commit 76e0fe2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/layer_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ end

__f = (x, ps) -> sum(first(pd(x, ps, st)))
@test_gradients(__f, x, ps; atol=1.0f-3, rtol=1.0f-3, broken_backends=[AutoTracker()])

pd2 = Layers.PositiveDefinite(model, ones(2))
ps, st = Lux.setup(StableRNG(0), pd2) |> dev

x0 = ones(Float32, 2) |> aType
y, _ = pd2(x0, ps, st)

@test all(y .== 0.0f0)
end
end

Expand Down

0 comments on commit 76e0fe2

Please sign in to comment.