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.78k stars 6.79k forks source link

mx.np.broadcast_to has undocumented features #18638

Open leezu opened 4 years ago

leezu commented 4 years ago

Following https://github.com/apache/incubator-mxnet/pull/17358, broadcast_to op can infer shape from input tensor with magic parameter -2. This is undocumented.

https://github.com/apache/incubator-mxnet/blob/cf3984bf5c67cb7d1feeb5b3cb55a41ca995e5c8/python/mxnet/ndarray/numpy/_op.py#L285-L308

xidulu commented 4 years ago

I believe the reason behind is that we would like to keep the documentation and feature consistent with the origin NumPy, so this magic api is not supposed to be known by users.