Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[Numpy] Whether to support 'exclude' flag in numpy operators #18805

Open
sxjscience opened this issue Jul 28, 2020 · 1 comment
Open

[Numpy] Whether to support 'exclude' flag in numpy operators #18805

sxjscience opened this issue Jul 28, 2020 · 1 comment

Comments

@sxjscience
Copy link
Member

In the old ndarray API, we support mx.nd.mean(x, axis=1, exclude=True), in which the meaning is to sum up the axes except axis=1. We do not have the exclude option in mx.np.mean() so it will be good to have.

See the following code snippet for an example:

https://github.com/apache/incubator-mxnet/blob/74430a92f5232808a169c9e238a419789a5c2fda/python/mxnet/gluon/loss.py#L149-L152

Another option is to directly switch to use DeferedCompute so there is no need to add this option.

@szha
Copy link
Member

szha commented Aug 8, 2020

While this design made a difference when we needed to program in the symbolic way, since in 2.0 the array interface provides eager type inference, our array can behave just like numpy ndarray so this design shouldn't be required anymore. As such, I'm leaning towards that it's still better to be as consistent with the numpy API as possible in the np module.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants