Skip to content
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

devec against an array of arrays #31

Open
hayd opened this issue Jun 25, 2014 · 0 comments
Open

devec against an array of arrays #31

hayd opened this issue Jun 25, 2014 · 0 comments

Comments

@hayd
Copy link

hayd commented Jun 25, 2014

If you try and @devec with array of arrays it fails (for example these are two distinct errors):

julia> v = [rand(5) for _ in 1:5];

julia> sum(v);  # works ok

julia> @devec a = sum(v)
ERROR: no method zero(Type{Array{Float64,1}})
 in anonymous at no file

julia> p = [rand(5, 5) for _ in 1:5];

julia> p .* v;  # works ok

julia> @devec a = p .* v
ERROR: no method get_value(Array{Array{Float64,2},1}, Int64)
 in anonymous at no file

This came up trying to solve one of the 100 numpy/julia problems.

Note: The same error is returned using ImmutableArrays (with more specific types). I'm not sure what could be used in the else block...

hayd added a commit to hayd/julia-100-exercises that referenced this issue Jun 25, 2014
Does this qualify as "at once" ?

I had wanted to use `@devec` to do this without the temporary, but for the moment (as far as I can make out) this appears not to be possible lindahua/Devectorize.jl#31.

Also, fix question 3 (atm it's a repeat of 2).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant