You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/12/26 21:23:04 UTC
[GitHub] [incubator-mxnet] sxjscience opened a new issue #17179: [Numpy]
where does not support python scalar as the input
sxjscience opened a new issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179
```python
import mxnet as mx
mx.npx.set_np()
a = mx.np.sym.var('a')
a = mx.sym.var('a').as_np_ndarray()
mx.sym.np.where(a, a, 0)
```
Error message:
```
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-5-e7a6fe89b743> in <module>
----> 1 mx.sym.np.where(a, a, 0)
~/mxnet/python/mxnet/symbol/numpy/_symbol.py in where(condition, x, y)
5501
5502 """
-> 5503 return _npi.where(condition, x, y, out=None)
5504
5505
~/mxnet/python/mxnet/symbol/register.py in where(condition, x, y, name, attr, out, **kwargs)
AssertionError: Argument y must be Symbol instances, but got 0
```
Also, the imperative case:
```python
import mxnet as mx
mx.npx.set_np()
mx.np.where(mx.np.ones((10, )), mx.np.ones((10, )), 0)
```
Error message:
```
AssertionError Traceback (most recent call last)
<ipython-input-14-bdddf3065582> in <module>
----> 1 mx.np.where(mx.np.ones((10, )), mx.np.ones((10, )), 0)
~/mxnet/python/mxnet/numpy/multiarray.py in where(condition, x, y)
7996 [ 0., 3., -1.]])
7997 """
-> 7998 return _mx_nd_np.where(condition, x, y)
7999
8000
~/mxnet/python/mxnet/ndarray/numpy/_op.py in where(condition, x, y)
6035 return nonzero(condition)
6036 else:
-> 6037 return _npi.where(condition, x, y, out=None)
6038
6039
~/mxnet/python/mxnet/ndarray/register.py in where(condition, x, y, out, name, **kwargs)
AssertionError: Argument y must have NDArray type, but got 0
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] hgt312 commented on issue #17179: [Numpy] where
does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
hgt312 commented on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-569874013
I will add the scalar version soon.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] sxjscience commented on issue #17179: [Numpy]
where does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
sxjscience commented on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-569863837
@xidulu In my use case, I'm using the symbolic interface so I cannot call `mx.np.array`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] sxjscience edited a comment on issue #17179:
[Numpy] where does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
sxjscience edited a comment on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-569863837
@xidulu @hgt312 In my use case, I'm using the symbolic interface so I cannot call `mx.np.array`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] xidulu commented on issue #17179: [Numpy] where
does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
xidulu commented on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-569201820
I actually mentioned this problem in the PR, https://github.com/apache/incubator-mxnet/pull/16829#issuecomment-554489820
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] xidulu edited a comment on issue #17179: [Numpy]
where does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
xidulu edited a comment on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-569201820
I actually mentioned this problem in the PR, https://github.com/apache/incubator-mxnet/pull/16829#issuecomment-554489820
The author suggested that you should wrap the scalar with`np.array`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] samskalicky commented on issue #17179: [Numpy]
where does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
samskalicky commented on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-569774113
@apeforest assign [@reminisce ]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] sxjscience commented on issue #17179: [Numpy]
where does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
sxjscience commented on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-571857347
Are we able to make it numpy compatible?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] hgt312 commented on issue #17179: [Numpy] where
does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
hgt312 commented on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-571009930
If both `x` and `y` are scalars, dtype of the output should be what? In official numpy, it may be `int64` or `float64` according to the inputs' type.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] reminisce commented on issue #17179: [Numpy]
where does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
reminisce commented on issue #17179: [Numpy] where does not support python scalar as the input
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-569864388
@hgt312
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-mxnet] yzhliu commented on issue #17179: [Numpy] where does not support python scalar as the input
Posted by GitBox <gi...@apache.org>.
yzhliu commented on issue #17179:
URL: https://github.com/apache/incubator-mxnet/issues/17179#issuecomment-621522384
Closed by #17249
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org