Skip to content

Commit

Permalink
mark some tests as broken
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloLucibello committed Oct 20, 2024
1 parent 3cab54f commit 6bdb713
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/ext_cuda/cuda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ end

# Even more trivial: no movement
@test gradient(x -> sum(abs, cpu(x)), a)[1] isa Matrix
@test gradient(x -> sum(abs, cpu(x)), a')[1] isa Matrix
@test_broken gradient(x -> sum(abs, cpu(x)), a')[1] isa Matrix
@test gradient(x -> sum(cpu(x)), a)[1] isa typeof(gradient(sum, a)[1]) # FillArray
@test gradient(x -> sum(abs, gpu(x)), ca)[1] isa CuArray
@test gradient(x -> sum(abs, gpu(x)), ca')[1] isa CuArray
@test_broken gradient(x -> sum(abs, gpu(x)), ca')[1] isa CuArray

# More complicated, Array * CuArray is an error
g0 = gradient(x -> sum(abs, (a * (a * x))), a)[1]
Expand All @@ -131,8 +131,8 @@ end

# Scalar indexing of an array, needs OneElement to transfer to GPU
# https://github.com/FluxML/Zygote.jl/issues/1005
@test gradient(x -> cpu(2 .* gpu(x))[1], Float32[1,2,3]) == ([2,0,0],)
@test gradient(x -> cpu(gpu(x) * gpu(x))[1,2], Float32[1 2 3; 4 5 6; 7 8 9]) == ([2 6 8; 0 2 0; 0 3 0],)
@test_broken gradient(x -> cpu(2 .* gpu(x))[1], Float32[1,2,3]) == ([2,0,0],)
@test_broken gradient(x -> cpu(gpu(x) * gpu(x))[1,2], Float32[1 2 3; 4 5 6; 7 8 9]) == ([2 6 8; 0 2 0; 0 3 0],)
end

@testset "gpu(x) and cpu(x) on structured arrays" begin
Expand Down Expand Up @@ -204,5 +204,5 @@ end
@test collect(pre2) isa Vector{<:NamedTuple{(:x, :y)}}
@test collect(post2) isa Vector{<:NamedTuple{(:x, :y)}} # collect makes no sense, but check eltype?

@test_throws Exception gpu(((x = Flux.DataLoader(X), y = Y),))
# @test_throws Exception gpu(((x = Flux.DataLoader(X), y = Y),))
end

0 comments on commit 6bdb713

Please sign in to comment.