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 2017/11/25 20:15:15 UTC
[GitHub] marfago opened a new issue #8817: Creating a monodimensional sparse array returns an error
marfago opened a new issue #8817: Creating a monodimensional sparse array returns an error
URL: https://github.com/apache/incubator-mxnet/issues/8817
Hello,
The following code
```
b1 = nd.sparse.zeros('csr',shape=10, ctx=ctx)
```
returns
```
/usr/local/lib/python3.6/site-packages/mxnet/ndarray/sparse.py in _new_alloc_handle(stype, shape, ctx, delay_alloc, dtype, aux_types, aux_shapes)
87 check_call(_LIB.MXNDArrayCreateSparseEx(
88 ctypes.c_int(int(_STORAGE_TYPE_STR_TO_ID[stype])),
---> 89 c_array(mx_uint, shape),
90 mx_uint(len(shape)),
91 ctypes.c_int(ctx.device_typeid),
/usr/local/lib/python3.6/site-packages/mxnet/base.py in c_array(ctype, values)
214 2.0
215 """
--> 216 return (ctype * len(values))(*values)
217
218 def ctypes2buffer(cptr, length):
TypeError: object of type 'int' has no len()
```
but
```
b1 = nd.zeros(shape=10, ctx=ctx)
```
works fine.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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