You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mxnet.apache.org by JackieWu <no...@github.com> on 2019/08/29 01:39:56 UTC

Re: [apache/incubator-mxnet] [RFC] Introducing NumPy-compatible coding experience into MXNet (#14253)

Hi @reminisce , I try to pass a numpy-compatible array into a legacy operator, and it raises this error.

```python
>>> import mxnet.numpy as np
>>> import mxnet as mx
>>> import mxnet.numpy as np
>>> a = np.array([1,2])
>>> b = np.array([3,4])
>>> mx.nd.broadcast_add(a,b)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 56, in broadcast_add
  File "/home/wkcn/proj/mxnet/python/mxnet/ndarray/register.py", line 99, in _verify_all_legacy_ndarrays
    .format(op_name, func_name))
TypeError: Operator `broadcast_add` registered in backend is known as `broadcast_add` in Python. This is a legacy operator which can only accept legacy ndarrays, while received an MXNet numpy ndarray. Please call `as_nd_ndarray()` upon the numpy ndarray to convert it to a legacy ndarray, and then feed the converted array to this operator.
```

I hope that the legacy operator is the subset of 

-- 
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-mxnet/issues/14253#issuecomment-525985724