apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.77k stars 6.79k forks source link

Python stubs for static type checking #8359

Open jaanli opened 6 years ago

jaanli commented 6 years ago

Static type checking helps avoid bugs - would be great to have an mxnet stub here:

https://github.com/python/typeshed

KellenSunderland commented 6 years ago

I agree. I see in the release notes for mxnet 12 RC0 that they're providing IDEs like pycharm with code completion hints. I wonder if this means someone has already generated stubs?

https://cwiki.apache.org/confluence/display/MXNET/MXNet+0.12.0+Release+Notes

eric-haibin-lin commented 6 years ago

ping @szha who worked on IDE integration

szha commented 6 years ago

Yes, stubs are already generated, though it's not pyi. Let me know if you need pointers on the code generation.

One potential problem in type checking mxnet API is that some APIs may return more than one types, and the return type depends on the argument, due to legacy design.

KellenSunderland commented 6 years ago

Pinging @tdomhan , who was also hoping to see this feature.