dmlc / MXNet.jl

MXNet Julia Package - flexible and efficient deep learning in Julia
371 stars 70 forks source link

NDArray with parametric type? #323

Open iblislin opened 6 years ago

iblislin commented 6 years ago

Should we make NDArray be parametric like Base's Array? One of the benefit I can tell is that it will help for multiple dispatch, but how about the performance?

iblislin commented 6 years ago

BTW, what's the pros and cons if we make NDArray as an subtype of AbstractArray?

vchuravy commented 6 years ago

I have been wanting to make NDArray parametric for quite some time. #233 was one of the points where having it not be parametric caused big performance problems. I am not quite convinced if NDArray should be a subtype of AbstractArray, but maybe it should if we are pushing to make MXNet.jl more in line with Julia semantics.

iblislin commented 6 years ago

ok, I want to make NDArray parametric first #331

pluskid commented 6 years ago

I have no objection. What would the libmxnet function on NDArrays become? Are we going to define functions for all combinations of NDArrays or just define for the non-typed version?

iblislin commented 6 years ago

some of them benifit from dispatching, e.g. https://github.com/dmlc/MXNet.jl/pull/331/files#diff-0ca423d226049cc5744ebade856d9f1bR666

And most of functions are using UnionAll (NDArray without any parameter) type

pluskid commented 6 years ago

Thanks! This looks good to me.