Change to array due to "type definition not allowed inside a local scope"

This commit is contained in:
DrChainsaw 2019-07-09 01:15:55 +02:00
parent 16d5f2bc24
commit 9b96a3d69b
1 changed files with 4 additions and 5 deletions

View File

@ -90,11 +90,10 @@ end
c = Chain(m, m)
@test size.(params(c)) == [(5, 10), (5, 5), (5,), (5,)]
# Recursive struct. Just want params, no stack overflow pls.
mutable struct R m;r end
Flux.@treelike R
r = R(m, nothing)
r.r = r
# Self-referential array. Just want params, no stack overflow pls.
r = Any[nothing,m]
Flux.children(a::Vector{Any}) = Tuple(a)
r[1] = r
@test size.(params(r)) == [(5, 10), (5, 5), (5,), (5,)]
end