diff --git a/src/utils.jl b/src/utils.jl index d25f8e2bfb..4f4e440f87 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -9,7 +9,6 @@ const AArray = AbstractArray initn(dims...) = randn(dims...)/100 unsqueeze(xs, dim = 1) = reshape(xs, (size(xs)[1:dim-1]..., 1, size(xs)[dim:end]...)) -Base.squeeze(xs) = squeeze(xs, 1) stack(xs, dim = 1) = cat(dim, unsqueeze.(xs, dim)...) unstack(xs, dim = 1) = [slicedim(xs, dim, i) for i = 1:size(xs, dim)] diff --git a/test/recurrent.jl b/test/recurrent.jl index 3f04d6c48d..7610ea1300 100644 --- a/test/recurrent.jl +++ b/test/recurrent.jl @@ -13,5 +13,5 @@ end _, ys = apply(unroll1(r).model, xs, (r.y.x,)) @test ys[1] == tanh(xs[1] * r.Wxy.x .+ r.y.x * r.Wyy.x .+ r.by.x) ru = unroll(r, 3) - ru(batchone(Seq(squeeze.(xs))))[1] == squeeze.(ys) + ru(batchone(Seq(squeeze.(xs, 1))))[1] == squeeze.(ys, 1) end