Skip to content

Commit 70e4797

Browse files
committed
deprecation msg for RNN getproperty
1 parent 4c645ce commit 70e4797

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/layers/recurrent.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ rnn.state = hidden(rnn.cell)
5353
reset!(m::Recur) = (m.state = m.cell.state0)
5454
reset!(m) = foreach(reset!, functor(m)[1])
5555

56+
# TODO remove in v0.13
5657
function Base.getproperty(m::Recur, sym::Symbol)
5758
if sym === :init
5859
@warn "Recur field :init has been deprecated. To access initial state weights, use m::Recur.cell.state0 instead."
@@ -100,6 +101,7 @@ output fed back into the input each time step.
100101
Recur(m::RNNCell) = Recur(m, m.state0)
101102
RNN(a...; ka...) = Recur(RNNCell(a...; ka...))
102103

104+
# TODO remove in v0.13
103105
function Base.getproperty(m::RNNCell, sym::Symbol)
104106
if sym === :h
105107
@warn "RNNCell field :h has been deprecated. Use m::RNNCell.state0 instead."
@@ -158,6 +160,7 @@ for a good overview of the internals.
158160
Recur(m::LSTMCell) = Recur(m, m.state0)
159161
LSTM(a...; ka...) = Recur(LSTMCell(a...; ka...))
160162

163+
# TODO remove in v0.13
161164
function Base.getproperty(m::LSTMCell, sym::Symbol)
162165
if sym === :h
163166
@warn "LSTMCell field :h has been deprecated. Use m::LSTMCell.state0[1] instead."
@@ -209,6 +212,7 @@ for a good overview of the internals.
209212
Recur(m::GRUCell) = Recur(m, m.state0)
210213
GRU(a...; ka...) = Recur(GRUCell(a...; ka...))
211214

215+
# TODO remove in v0.13
212216
function Base.getproperty(m::GRUCell, sym::Symbol)
213217
if sym === :h
214218
@warn "GRUCell field :h has been deprecated. Use m::GRUCell.state0 instead."

0 commit comments

Comments
 (0)