Skip to content

Commit d92ed90

Browse files
Add tests for chain indexing
First time making tests, here goes...!
1 parent 4391a17 commit d92ed90

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/layers/basic.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ import Flux: activations
3131
@test_throws ArgumentError Chain(layers = Dense(10, 10), two = identity) # reserved name
3232

3333
@test_nowarn Chain([Dense(10, 5, σ), Dense(5, 2)])(randn(Float32, 10)) # vector of layers
34+
35+
c = Chain(Dense(10, 5, σ), Dense(5, 2), Dense(2, 1, relu))
36+
@test c[1] == c[begin]
37+
@test c[3] == c[end]
3438
end
3539

3640
@testset "Activations" begin

0 commit comments

Comments
 (0)