File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11name = " Zygote"
22uuid = " e88e6eb3-aa80-5325-afca-941959d7151f"
3- version = " 0.6.16 "
3+ version = " 0.6.17 "
44
55[deps ]
66AbstractFFTs = " 621f4979-c628-5d54-868e-fcf4e3e8185c"
Original file line number Diff line number Diff line change @@ -3,18 +3,16 @@ struct IdSet{T} <: AbstractSet{T}
33 IdSet {T} () where T = new (IdDict {T,Nothing} ())
44end
55
6- Base . eltype ( :: IdSet{T} ) where T = T
6+ IdSet (xs) = IdSet {eltype(xs)} (xs)
77
88IdSet () = IdSet {Any} ()
99
10+ IdSet {T} (xs) where T = isempty (xs) ? IdSet {T} () : push! (IdSet {T} (), xs... )
11+
1012Base. push! (s:: IdSet{T} , x:: T ) where T = (s. dict[x] = nothing ; s)
1113Base. delete! (s:: IdSet{T} , x:: T ) where T = (delete! (s. dict, x); s)
1214Base. in (x, s:: IdSet ) = haskey (s. dict, x)
13-
14- IdSet {T} (xs) where T = push! (IdSet {T} (), xs... )
15-
16- IdSet (xs) = IdSet {eltype(xs)} (xs)
17-
15+ Base. eltype (:: IdSet{T} ) where T = T
1816Base. collect (s:: IdSet ) = Base. collect (keys (s. dict))
1917Base. similar (s:: IdSet , T:: Type ) = IdSet {T} ()
2018
Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ using Zygote: Grads
8282 @test ps isa Params
8383 @test issetequal (ps, Set ([y]))
8484 end
85+
86+ @testset " constructor with empty args" begin
87+ @test length (Params ()) == 0
88+ @test length (Params (())) == 0
89+ @test length (Params ([])) == 0
90+ end
8591end
8692
8793@testset " Grads" begin
You can’t perform that action at this time.
0 commit comments