Skip to content

Commit 0dfddb8

Browse files
fix
1 parent dd30ce8 commit 0dfddb8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: src/dataloader.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -164,19 +164,19 @@ function DataLoader(
164164

165165
# Wrapping with ObsView in order to work around
166166
# issue https://github.com/FluxML/Flux.jl/issues/1935
167-
data = ObsView(data)
167+
_data = ObsView(data)
168168
if batchsize > 0
169-
data = BatchView(data; batchsize, partial, collate)
169+
_data = BatchView(_data; batchsize, partial, collate)
170170
end
171171

172172
if buffer == true
173-
buffer = _create_buffer(data)
173+
buffer = _create_buffer(_data)
174174
end
175175
P = parallel ? :parallel : :serial
176176
# for buffer == false and external buffer, we keep as is
177177

178-
T, B, C, R = typeof(data), typeof(buffer), typeof(collate), typeof(rng)
179-
return DataLoader{T,B,P,C,R}(data, batchsize, buffer,
178+
T, O, B, C, R = typeof(_data), typeof(data), typeof(buffer), typeof(collate), typeof(rng)
179+
return DataLoader{T,B,P,C,O,R}(data, _data, batchsize, buffer,
180180
partial, shuffle, parallel, collate, rng)
181181
end
182182

0 commit comments

Comments
 (0)