make chain collectable
This commit is contained in:
parent
db3f477e15
commit
496dbfabd2
@ -21,8 +21,8 @@ struct Chain{T<:Tuple}
|
|||||||
Chain(xs...) = new{typeof(xs)}(xs)
|
Chain(xs...) = new{typeof(xs)}(xs)
|
||||||
end
|
end
|
||||||
|
|
||||||
@forward Chain.layers Base.getindex, Base.first, Base.last, Base.lastindex
|
@forward Chain.layers Base.getindex, Base.length, Base.first, Base.last,
|
||||||
@forward Chain.layers Base.iterate
|
Base.iterate, Base.lastindex
|
||||||
|
|
||||||
children(c::Chain) = c.layers
|
children(c::Chain) = c.layers
|
||||||
mapchildren(f, c::Chain) = Chain(f.(c.layers)...)
|
mapchildren(f, c::Chain) = Chain(f.(c.layers)...)
|
||||||
|
Loading…
Reference in New Issue
Block a user