Skip to content

Commit 5927ef1

Browse files
cleanup
1 parent e804b60 commit 5927ef1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Flux.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ using Zygote, MacroTools, Juno, Reexport
88
using MacroTools: @forward
99
@reexport using NNlib
1010
using Zygote: Params, @adjoint, gradient, pullback, @nograd
11-
using Functors: @functor, functor, fmap, isleaf
11+
using Functors: Functors, @functor, functor, fmap
1212
export gradient
1313

1414
export Chain, Dense, Maxout, SkipConnection, Parallel, flatten,

src/layers/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ end
4141
@forward Chain.layers Base.getindex, Base.length, Base.first, Base.last,
4242
Base.iterate, Base.lastindex, Base.keys
4343

44-
functor(::Type{<:Chain}, c) = c.layers, ls -> Chain(ls...)
44+
Functors.functor(::Type{<:Chain}, c) = c.layers, ls -> Chain(ls...)
4545

4646
applychain(::Tuple{}, x) = x
4747
applychain(fs::Tuple, x) = applychain(tail(fs), first(fs)(x))

src/layers/show.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function _big_show(io::IO, obj, indent::Int=0, name=nothing)
4343
end
4444
end
4545

46-
_show_leaflike(x) = isleaf(x) # mostly follow Functors, except for:
46+
_show_leaflike(x) = Functors.isleaf(x) # mostly follow Functors, except for:
4747
_show_leaflike(::Tuple{Vararg{<:Number}}) = true # e.g. stride of Conv
4848
_show_leaflike(::Tuple{Vararg{<:AbstractArray}}) = true # e.g. parameters of LSTMcell
4949
_show_leaflike(::Diagonal) = true # appears inside LayerNorm
@@ -97,7 +97,7 @@ function _big_finale(io::IO, m)
9797
end
9898

9999
_childarray_sum(f, x::AbstractArray) = f(x)
100-
_childarray_sum(f, x) = isleaf(x) ? 0 : sum(y -> _childarray_sum(f, y), Functors.children(x))
100+
_childarray_sum(f, x) = Functors.isleaf(x) ? 0 : sum(y -> _childarray_sum(f, y), Functors.children(x))
101101

102102
# utility functions
103103

0 commit comments

Comments
 (0)