You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
For example:
in mxnet.numpy
for two ndarray a,b with dtype='int64', the dtype of result c = a / b is 'float32'
in numpy
the dtype is 'float64'
Generally, when calculating division, mxnet.numpy often uses float32 while numpy uses float64.
Using float32 will often lead to the loss of floating point precision.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/incubator-mxnet/python/mxnet/numpy/multiarray.py", line 991, in __eq__
return equal(self, other)
File "/home/ubuntu/incubator-mxnet/python/mxnet/numpy/multiarray.py", line 8451, in equal
return _mx_nd_np.equal(x1, x2, out)
File "/home/ubuntu/incubator-mxnet/python/mxnet/ndarray/numpy/_op.py", line 6622, in equal
return _api_internal.equal(x1, x2, out)
File "/home/ubuntu/incubator-mxnet/python/mxnet/_ffi/_ctypes/function.py", line 115, in __call__
raise get_last_ffi_error()
mxnet.base.MXNetError: MXNetError: Type inconsistent, Provided = float32, inferred type = int32
But numpy supports equal operation between different types
fail to use mxnet.numpy.prod(a.shape)
>>> mx.np.prod(a.shape)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 31, in prod
AssertionError: Argument a must have NDArray type, but got (5,)
while numpy supports that.
mxnet.numpy.ndarray.diagonal() is not supported
The text was updated successfully, but these errors were encountered:
different dtype when calculating division
For example:
in mxnet.numpy
for two ndarray a,b with dtype='int64', the dtype of result c = a / b is 'float32'
in numpy
the dtype is 'float64'
Generally, when calculating division, mxnet.numpy often uses float32 while numpy uses float64.
Using float32 will often lead to the loss of floating point precision.
operator between different types
for example
it will raise Error:
But numpy supports equal operation between different types
fail to use mxnet.numpy.prod(a.shape)
while numpy supports that.
mxnet.numpy.ndarray.diagonal() is not supported
The text was updated successfully, but these errors were encountered: