Merge #877
877: Fix functor's `params!` to work with complex numbers r=MikeInnes a=PhilipVinc I believe you forgot to define `params!` for complex-valued arrays. If I'm wrong, feel free to close this. Co-authored-by: Filippo Vicentini <filippovicentini@gmail.com>
This commit is contained in:
commit
0d3aa8fa5e
@ -39,7 +39,7 @@ end
|
|||||||
|
|
||||||
trainable(m) = functor(m)[1]
|
trainable(m) = functor(m)[1]
|
||||||
|
|
||||||
params!(p::Params, x::AbstractArray{<:Real}, seen = IdSet()) = push!(p, x)
|
params!(p::Params, x::AbstractArray{<:Number}, seen = IdSet()) = push!(p, x)
|
||||||
|
|
||||||
function params!(p::Params, x, seen = IdSet())
|
function params!(p::Params, x, seen = IdSet())
|
||||||
x in seen && return
|
x in seen && return
|
||||||
|
Loading…
Reference in New Issue
Block a user