diff --git a/src/layers/conv.jl b/src/layers/conv.jl index e73e582f..78509c84 100644 --- a/src/layers/conv.jl +++ b/src/layers/conv.jl @@ -1,6 +1,6 @@ using NNlib: conv -@generated sub2(::Type{Val{N}}) where N = :(Val{$(N-2)}) +@generated sub2(::Type{Val{N}}) where N = :(Val($(N-2))) expand(N, i::Tuple) = i expand(N, i::Integer) = ntuple(_ -> i, N) @@ -32,7 +32,7 @@ Conv(w::AbstractArray{T,N}, b::AbstractVector{T}, σ = identity; Conv(k::NTuple{N,Integer}, ch::Pair{<:Integer,<:Integer}, σ = identity; init = initn, stride = 1, pad = 0, dilation = 1) where N = - Conv(param(init(k..., ch...)), param(zero(ch[2])), σ, + Conv(param(init(k..., ch...)), param(zeros(ch[2])), σ, stride = stride, pad = pad, dilation = dilation) @treelike Conv diff --git a/src/tracker/Tracker.jl b/src/tracker/Tracker.jl index 2c4951a9..190837ab 100644 --- a/src/tracker/Tracker.jl +++ b/src/tracker/Tracker.jl @@ -77,8 +77,7 @@ include("numeric.jl") Hook into gradient backpropagation. `x` is unmodified, but when backpropagating `f` will be applied to the incoming gradient. For example, `hook(-, x)` will reverse -the sign of the gradient applied to `x`. -""" +the sign of the gradient applied to `x`.""" hook(f, x) = istracked(x) ? track(hook, f, x) : x @grad hook(f, x) = data(x), Δ -> (nothing, f(Δ))