Skip to content

Commit 39fe9f9

Browse files
Add extra test for params (#2051)
* Add extra test for params * Update test/utils.jl Co-authored-by: Michael Abbott <32575566+mcabbott@users.noreply.github.com> Co-authored-by: Michael Abbott <32575566+mcabbott@users.noreply.github.com>
1 parent 6c747f3 commit 39fe9f9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/utils.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ end
263263
r = Any[nothing,m]
264264
r[1] = r
265265
@test size.(params(r)) == [(5, 10), (5, 5), (5,), (5, 1)]
266+
267+
# Ensure functor explores inside Transpose but not SubArray
268+
m = (x = view([1,2,3]pi, 1:2), y = transpose([4 5]pi))
269+
@test size.(Flux.params(m)) == [(2,), (1, 2)]
266270
end
267271

268272
@testset "Precision" begin

0 commit comments

Comments
 (0)