Add tests

This commit is contained in:
Katharine Hyatt 2019-10-23 09:22:22 -04:00
parent e0c1c0e057
commit f7ce717aaa
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@ cm = gpu(m)
x = [1,2,3]
cx = gpu(x)
@test Flux.crossentropy(x,x) Flux.crossentropy(cx,cx)
@test Flux.crossentropy(x,x, weight=1.0) Flux.crossentropy(cx,cx, weight=1.0)
@test_broken Flux.crossentropy(x,x, weight=[1.0;2.0;3.0]) Flux.crossentropy(cx,cx, weight=[1.0;2.0;3.0])
xs = rand(5, 5)
ys = Flux.onehotbatch(1:5,1:5)