copy methods for param
This commit is contained in:
parent
d35191595d
commit
9ecb1311a5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user