New issue
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
repeat does not work with KnetArray #635
Labels
Comments
As a temporary workaround until I fix this, I would recommend:
Or use |
Apparently, CUDA (as of 3.9.0) does not have such kernel either:
My workaround is to use an array of indices: KnetArray(ones(2,2))[:,:,ones(Int,3)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was using
repeat()
function to replicate a Float64 array and the following code seems to be working:a = randn(256, 5)
repeat(a,16,16)
but when I cast the array to a KnetArray type and try again,
a = KnetArray{}(randn(256, 5))
repeat(a,16,16)
I encounter the following error:
MethodError: no method matching repeat(::KnetArray{Float64,2}, ::Int64, ::Int64) Closest candidates are: repeat(!Matched::Union{GPUArrays.AbstractGPUArray{T,2}, GPUArrays.AbstractGPUArray{T,1}} where T, ::Int64, ::Int64) at C:\Users\canbe\.julia\packages\GPUArrays\Ck0bk\src\host\base.jl:3 repeat(!Matched::Union{AbstractArray{T,2}, AbstractArray{T,1}} where T, ::Integer, ::Integer) at abstractarraymath.jl:275 repeat(!Matched::AbstractArray, ::Integer...) at abstractarraymath.jl:273 ...
It looks like
repeat()
does not support KnetArray type. I'm using Julia Version 1.5.2 and Knet v1.4.3The text was updated successfully, but these errors were encountered: