Skip to content

Commit

Permalink
use views
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Chen <ToucheSir@users.noreply.github.com>
  • Loading branch information
DhairyaLGandhi and ToucheSir authored Aug 30, 2021
1 parent 226524c commit d1b1daf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/layers/recurrent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ end
flip(f, xs) = reverse(f.(reverse(xs)))

function (m::Recur)(x::AbstractArray{T, 3}) where T
h = [m(x[:, :, i]) for i in 1:size(x, 3)]
h = [m(view(x, :, :, i)) for i in 1:size(x, 3)]
sze = size(h[1])
reshape(reduce(hcat, h), sze[1], sze[2], length(h))
end
Expand Down

0 comments on commit d1b1daf

Please sign in to comment.