From 9803826a368fa3f527e9c2682876f168e11f75fc Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Mon, 20 Jan 2020 13:53:28 -0500 Subject: [PATCH] test restructure on the GPU Requires https://github.com/FluxML/Zygote.jl/pull/474 --- test/cuda/cuda.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/cuda/cuda.jl b/test/cuda/cuda.jl index 1576d88f..911eef93 100644 --- a/test/cuda/cuda.jl +++ b/test/cuda/cuda.jl @@ -58,6 +58,13 @@ end @test y[3,:] isa CuArray end +@testset "restructure gpu" begin + dudt = Dense(1,1) |> gpu + p,re = Flux.destructure(dudt) + foo(x) = sum(re(p)(x)) + @test gradient(foo, cu(rand(1)))[1] isa CuArray +end + if CuArrays.has_cudnn() @info "Testing Flux/CUDNN" include("cudnn.jl")