Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloLucibello committed Nov 4, 2024
1 parent 5bdf443 commit bec384f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,16 @@ end
m = Dense(10 => 5)
@test size.(Flux.trainables(m)) == [(5, 10), (5,)]
m = RNN(10 => 5)
@test size.(Flux.trainables(m)) == [(5, 10), (5, 5), (5,), (5, 1)]
@test size.(Flux.trainables(m)) == [(5, 10), (5, 5), (5,)]

# Layer duplicated in same chain, params just once pls.
c = Chain(m, m)
@test size.(Flux.trainables(c)) == [(5, 10), (5, 5), (5,), (5, 1)]
@test size.(Flux.trainables(c)) == [(5, 10), (5, 5), (5,)]

# Self-referential array. Just want params, no stack overflow pls.
r = Any[nothing,m]
r[1] = r
@test_broken size.(Flux.trainables(r)) == [(5, 10), (5, 5), (5,), (5, 1)]
@test size.(Flux.trainables(r)) == [(5, 10), (5, 5), (5,)]

# Ensure functor explores inside Transpose but not SubArray
m = (x = view([1,2,3]pi, 1:2), y = transpose([4 5]pi))
Expand Down

0 comments on commit bec384f

Please sign in to comment.