gpu

function defined in module Flux


			gpu(x)

Moves m to the current GPU device, if available. It is a no-op otherwise. See the CUDA.jl docs to help identify the current device.

This works for functions, and any struct marked with @functor .


			julia> m = Dense(1,2)
Dense(1, 2)

julia> typeof(m.W)
Matrix{Float32}

julia> m_gpu = gpu(m)
Dense(1, 2)

julia> typeof(m_gpu.W) # notice the type of the array changed to a CuArray
CuArray{Float32, 2}