Skip to content

Commit 60043fa

Browse files
bors[bot]maleadt
andauthored
Merge #1013
1013: Adapt to GPUArrays/CuArrays changes r=dhairyagandhi96 a=maleadt Changes in response to JuliaGPU/GPUArrays.jl@a29df67 and JuliaGPU/CuArrays.jl#576. I suppose the next CuArrays release will need to be breaking because of this. Maybe the `crossentropy` signature needs to be adjusted to support integer vectors, but I'll leave that decision up to Flux developers. This at least is the quick fix to get the tests passing again. Co-authored-by: Tim Besard <[email protected]>
2 parents ddc2c20 + e2c2ec5 commit 60043fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/cuda/cuda.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ cm = gpu(m)
2525
@test all(p isa CuArray for p in params(cm))
2626
@test cm(gpu(rand(10, 10))) isa CuArray{Float32,2}
2727

28-
x = [1,2,3]
28+
x = [1.,2.,3.]
2929
cx = gpu(x)
3030
@test Flux.crossentropy(x,x) Flux.crossentropy(cx,cx)
3131
@test Flux.crossentropy(x,x, weight=1.0) Flux.crossentropy(cx,cx, weight=1.0)
3232
@test Flux.crossentropy(x,x, weight=[1.0;2.0;3.0]) Flux.crossentropy(cx,cx, weight=cu([1.0;2.0;3.0]))
3333

3434
x = [-1.1491, 0.8619, 0.3127]
3535
y = [1, 1, 0.]
36-
@test Flux.binarycrossentropy.(σ.(x),y) Flux.binarycrossentropy.(cu(σ.(x)),cu(y))
37-
@test Flux.logitbinarycrossentropy.(x,y) Flux.logitbinarycrossentropy.(cu(x),cu(y))
36+
@test Flux.binarycrossentropy.(σ.(x),y) Array(Flux.binarycrossentropy.(cu(σ.(x)),cu(y)))
37+
@test Flux.logitbinarycrossentropy.(x,y) Array(Flux.logitbinarycrossentropy.(cu(x),cu(y)))
3838

3939
xs = rand(5, 5)
4040
ys = Flux.onehotbatch(1:5,1:5)

0 commit comments

Comments
 (0)