julia> Array(union(AFArray([1]), AFArray([4])))
ERROR: ArrayFire Error (202) : Invalid input argument
in throwAFerror(::Int32) at /Users/alha02/.julia/v0.5/ArrayFire/src/error.jl:50
in af_set_union(::Base.RefValue{Ptr{Void}}, ::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArra
y{Int64,1}, ::Bool) at /Users/alha02/.julia/v0.5/ArrayFire/src/wrap.jl:206
in #union#50(::Bool, ::Function, ::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArray{Int64,1})
at /Users/alha02/.julia/v0.5/ArrayFire/src/vector.jl:112
in union(::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArray{Int64,1}) at /Users/alha02/.julia
/v0.5/ArrayFire/src/vector.jl:111
Taking union works when the arrays are of length > 1:
julia> Array(union(AFArray([1,2]), AFArray([4,54]))) 4-element Array{Int64,1}: 1 2 4 54
but not when arrays are of length 1:
julia> Array(union(AFArray([1]), AFArray([4]))) ERROR: ArrayFire Error (202) : Invalid input argument in throwAFerror(::Int32) at /Users/alha02/.julia/v0.5/ArrayFire/src/error.jl:50 in af_set_union(::Base.RefValue{Ptr{Void}}, ::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArra y{Int64,1}, ::Bool) at /Users/alha02/.julia/v0.5/ArrayFire/src/wrap.jl:206 in #union#50(::Bool, ::Function, ::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArray{Int64,1}) at /Users/alha02/.julia/v0.5/ArrayFire/src/vector.jl:112 in union(::ArrayFire.AFArray{Int64,1}, ::ArrayFire.AFArray{Int64,1}) at /Users/alha02/.julia /v0.5/ArrayFire/src/vector.jl:111
even though they have the same type:
julia> Array(AFArray([1])) 1-element Array{Int64,1}: 1
julia> Array(AFArray([1, 4])) 2-element Array{Int64,1}: 1 4