lindahua / Devectorize.jl

A Julia framework for delayed expression evaluation
MIT License
115 stars 17 forks source link

devec against an array of arrays #31

Open hayd opened 10 years ago

hayd commented 10 years ago

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...