copy methods for param

This commit is contained in:
Mike J Innes 2017-03-08 15:36:25 +00:00
parent d35191595d
commit 9ecb1311a5

View File

@ -48,6 +48,7 @@ graph(m) = nothing
# Model parameters
# TODO: should be AbstractArray?
"""
A `Param` object stores a parameter array along with an accumulated delta to
that array. When converting to backends like TensorFlow, identical `Param`s will
@ -99,6 +100,9 @@ function Base.show(io::IO, p::Param)
print(io, "Param", size(p.x))
end
Base.copy!(xs, p::Param) = copy!(xs, p.x)
Base.copy!(p::Param, xs) = copy!(p.x, xs)
# Anonymous models
export Capacitor