mxnet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JackieWu <>
Subject Re: [apache/incubator-mxnet] [RFC] Introducing NumPy-compatible coding experience into MXNet (#14253)
Date Thu, 29 Aug 2019 01:39:56 GMT
Hi @reminisce , I try to pass a numpy-compatible array into a legacy operator, and it raises
this error.

>>> 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/", 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:
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message