You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is DataLoader type-unstable? Seems so. Does it have to be type-unstable?
using Flux
function test_data_loader(data_loader)
for (x,y) in data_loader
continue
end
end
X = rand(Float32, 2, 10)
Y = rand(Float32, 2, 10)
data_loader = Flux.DataLoader((data=X, label=Y))
@code_warntype test_data_loader(data_loader) # lots of red
If it is type-unstable and it's the intended behavior, it would be great to add a sentence This function is type-unstable to the docstring.
The text was updated successfully, but these errors were encountered:
I don't think it would be impossible to make iterate(::DataLoader) type stable, but it would be tricky since there are so many conditionally-applied wrappers here. @lorenzoh and @CarloLucibello thoughts? Do you recall why we moved away from creating the wrappers in the DataLoader constructor?
Is
DataLoader
type-unstable? Seems so. Does it have to be type-unstable?If it is type-unstable and it's the intended behavior, it would be great to add a sentence
This function is type-unstable
to the docstring.The text was updated successfully, but these errors were encountered: