cpu
function
defined in module
Flux
cpu(m)
Copies
m
onto the CPU, the opposite of
gpu
. Recurses into structs marked
@functor
.
julia> m_gpu = Dense(CUDA.randn(2, 5))
Dense(5 => 2) # 12 parameters
julia> m_gpu.bias # matches the given weight matrix
2-element CuArray{Float32, 1, CUDA.Mem.DeviceBuffer}:
0.0
0.0
julia> m = m_gpu |> cpu
Dense(5 => 2) # 12 parameters
julia> m.bias
2-element Vector{Float32}:
0.0
0.0
There is
1
method for Flux.cpu
:
The following pages link back here:
How to visualize data, Variational autoencoders
interpretation/learner.jl , serialization.jl , tasks/predict.jl , training/lrfind.jl , Flux.jl , functor.jl , callbacks/logging/checkpointer.jl , callbacks/metrics.jl