From e943a39ee72037184b9e46d89c0af536c78effef Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Tue, 31 Oct 2017 16:37:33 +0000 Subject: [PATCH] combine special cases --- src/layers/recurrent.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/layers/recurrent.jl b/src/layers/recurrent.jl index 716bc574..599776ce 100644 --- a/src/layers/recurrent.jl +++ b/src/layers/recurrent.jl @@ -1,5 +1,7 @@ # TODO: broadcasting cat -combine(x, h) = vcat(x, h .* trues(1, size(x, 2))) +combine(x::AbstractMatrix, h::AbstractVector) = vcat(x, h .* trues(1, size(x, 2))) +combine(x::AbstractVector, h::AbstractVector) = vcat(x, h) +combine(x::AbstractMatrix, h::AbstractMatrix) = vcat(x, h) # Stateful recurrence