update Testset of basic.jl

This commit is contained in:
Johnny Chen 2018-08-23 22:29:03 +08:00
parent 81e5f7c991
commit 4baf85bbe2
1 changed files with 2 additions and 2 deletions

View File

@ -11,8 +11,8 @@ using Test, Random
@testset "Dense" begin
@test length(Dense(10, 5)(randn(10))) == 5
@test_throws DimensionMismatch Dense(10, 5)(randn(1))
@test_throws DimensionMismatch Dense(10, 5)(1) # avoid broadcasting
@test_throws DimensionMismatch Dense(10, 5).(randn(10)) # avoid broadcasting
@test_throws MethodError Dense(10, 5)(1) # avoid broadcasting
@test_throws MethodError Dense(10, 5).(randn(10)) # avoid broadcasting
Random.seed!(0)
@test all(Dense(10, 1)(randn(10)).data .≈ 1.1774348382231168)