make this immutable again

This commit is contained in:
Mike J Innes 2017-03-29 17:47:43 +01:00
parent 2082d9db5c
commit 7e983c74cb

View File

@ -127,7 +127,7 @@ graph(cap::Capacitor) = cap.graph
# Recurrent Models # Recurrent Models
mutable struct Stateful <: Model struct Stateful <: Model
model model
state::Vector{Any} state::Vector{Any}
end end
@ -135,7 +135,7 @@ end
function (m::Stateful)(x) function (m::Stateful)(x)
runrawbatched(x) do x runrawbatched(x) do x
state, y = runmodel(m.model, (m.state...,), x) state, y = runmodel(m.model, (m.state...,), x)
m.state = collect(state) m.state .= state
return y return y
end end
end end