Skip to content

Commit

Permalink
fix cpu(dataloader)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarloLucibello authored Feb 6, 2025
1 parent 009d984 commit 6d9fa61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ julia> Flux.DataLoader((x = ones(2,10), y=2:11) |> gpu, batchsize=3)
it will not work on (say) a tuple of `DataLoader`s.
"""
function gpu(d::MLUtils.DataLoader)
MLUtils.DataLoader(MLUtils.mapobs(gpu, d.data),
MLUtils.DataLoader(MLUtils.mapobs(gpu, d.data);
d.batchsize,
d.buffer,
d.partial,
Expand All @@ -238,7 +238,7 @@ function gpu(d::MLUtils.DataLoader)
end

function cpu(d::MLUtils.DataLoader)
MLUtils.DataLoader(MLUtils.mapobs(cpu, d.data),
MLUtils.DataLoader(MLUtils.mapobs(cpu, d.data);
d.batchsize,
d.buffer,
d.partial,
Expand Down

0 comments on commit 6d9fa61

Please sign in to comment.