-
-
Notifications
You must be signed in to change notification settings - Fork 616
Closed
Description
Currently (as of Flux 0.15), Flux.cpu
and Flux.gpu
do not error when fed a view, but they simply return an identical value, without moving data to / from the GPU.
MWE
julia> using Flux, CUDA, cuDNN
julia> cpu_view = view(rand(2, 2), 1, :);
julia> gpu_view = view(CUDA.rand(2, 2), 1, :);
julia> Flux.gpu(cpu_view)
2-element view(::Matrix{Float64}, 1, :) with eltype Float64:
0.10101004098832933
0.7891135815339817
julia> Flux.cpu(gpu_view)
2-element view(::CuArray{Float32, 2, CUDA.DeviceMemory}, 1, :) with eltype Float32:
0.5095508
0.93324655
Dependencies:
[052768ef] CUDA v5.5.2
[587475ba] Flux v0.15.2
[02a925ec] cuDNN v1.4.0
on Julia 1.11.2
On Flux 0.14, Flux.cpu
and Flux.gpu
would transform views by applying the transformation to the parent array.