## Description
Shapes given in the Value error seem to be mismatched between expected and got
Python
Compiler: visual studio
MXNet commit hash: 769165b1794f9067e42c65477b3c2fe91a606f89
## Error Message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/bapac/workspace/incubator-mxnet/python/mxnet/ndarray/utils.py",
line 146, in array
return _array(source_array, ctx=ctx, dtype=dtype)
File
"/Users/bapac/workspace/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line
2489, in array
arr[:] = source_array
File
"/Users/bapac/workspace/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line
444, in __setitem__
self._set_nd_basic_indexing(key, value)
File
"/Users/bapac/workspace/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line
710, in _set_nd_basic_indexing
self._sync_copyfrom(value)
File
"/Users/bapac/workspace/incubator-mxnet/python/mxnet/ndarray/ndarray.py", line
872, in _sync_copyfrom
str(self.shape), str(source_array.shape)))
ValueError: Shape inconsistent: expected () vs got (1,)
## Minimum reproducible example
`mx.nd.array(1)`
Correct way of initialization right now is to feed a list,
```
>>> a=mx.nd.array([1])
>>> a
[1.]
<NDArray 1 @cpu(0)>
```
Shape of such an NDarray is
```
>>> a.shape
(1,)
```
Meaning, it expects (1,)
However, when we feed ()
It should give error
`ValueError: Shape inconsistent: expected (1,) vs got ()`
[ Full content available at:
https://github.com/apache/incubator-mxnet/issues/12676 ]
This message was relayed via gitbox.apache.org for [email protected]