We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When batching over a single array, stuff goes wrong:
julia> a = CuArrays.ones(10) 10-element CuArray{Float32,1,Nothing}: 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 julia> for (i, batch) in enumerate(CuIterator(Iterators.partition(a, 5))) @show i batch end i = 1 batch = Float32[1.0, 1.0, 1.0, 1.0, 1.0] ERROR: MethodError: no method matching unsafe_free!(::Float32)
The docs should probably also use Iterators.partition, it's a nice way of expressing this.
Iterators.partition
The text was updated successfully, but these errors were encountered:
Workaround:
julia> for (i, (batch,)) in enumerate(CuIterator(map(tuple, Iterators.partition(a, 5)))) @show i batch end i = 1 batch = Float32[1.0, 1.0, 1.0, 1.0, 1.0] i = 2 batch = Float32[1.0, 1.0, 1.0, 1.0, 1.0]
Sorry, something went wrong.
This works now.
No branches or pull requests
When batching over a single array, stuff goes wrong:
The docs should probably also use
Iterators.partition
, it's a nice way of expressing this.The text was updated successfully, but these errors were encountered: