From 14affbc91bf290fa69e3b340a23a9584fcf946b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Madrid=20Menc=C3=ADa?= Date: Sun, 11 Aug 2019 13:38:44 +0200 Subject: [PATCH] Use `CuArrays.ones` instead `cuones` which is deprecated --- src/cuda/curnn.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cuda/curnn.jl b/src/cuda/curnn.jl index 4990599f..c60104d2 100644 --- a/src/cuda/curnn.jl +++ b/src/cuda/curnn.jl @@ -130,8 +130,8 @@ end # TODO: can we just manipulate strides here? # TODO: should use repmat, but this isn't implemented. hBatch(x::AbstractVector, h::CuVector) = h -hBatch(x::AbstractMatrix, h::CuVector) = h .* cuones(1, size(x, 2)) -hBatch(x::AbstractMatrix, h::CuMatrix) = h .* cuones(1, size(h,2) == 1 ? size(x,2) : 1) +hBatch(x::AbstractMatrix, h::CuVector) = h .* CuArrays.ones(1, size(x, 2)) +hBatch(x::AbstractMatrix, h::CuMatrix) = h .* CuArrays.ones(1, size(h,2) == 1 ? size(x,2) : 1) function forward(rnn::RNNDesc{T}, x::CuArray{T}, h_::CuArray{T}, c_ = nothing, train = Val{false}) where T h = hBatch(x, h_)