ArrayFire.jl
ArrayFire.jl copied to clipboard
Dispatch issue
Julia dispatch issue:
Let’s say we have AFArray <: AbstractArray{T,4}
now there are methods that are dispatched across AFArray
and AFAbstractArray
f1 = sum{T,N}(a::AbstractArray{T<:Any, T<:Any})
f2 = sum{T}(a::AFArray{T})
now suppose a
is an AFArray
, and I call sum(a)
, Julia should call f2
, but doesn't.
@vtjnash suggests defining f2 as sum{T}(a::AbstractArray{T,4})
to get it to work. Have to experiment with it.