Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Cannot create large ndarray from numpy  #13070

@eric-haibin-lin

Description

@eric-haibin-lin
>>> import mxnet as mx
>>> import numpy as np
>>> a = np.empty((5000000000,))
>>> a
array([0., 0., 0., ..., 0., 0., 0.])
>>> b = mx.nd.array(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.local/lib/python2.7/site-packages/mxnet/ndarray/utils.py", line 146, in array
    return _array(source_array, ctx=ctx, dtype=dtype)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/mxnet/ndarray/ndarray.py", line 2488, in array
    arr = empty(source_array.shape, ctx, dtype)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/mxnet/ndarray/ndarray.py", line 3877, in empty
    return NDArray(handle=_new_alloc_handle(shape, ctx, False, dtype))
  File "/home/ubuntu/.local/lib/python2.7/site-packages/mxnet/ndarray/ndarray.py", line 134, in _new_alloc_handle
    c_array_buf(mx_uint, native_array('I', shape)),
OverflowError: unsigned int is greater than maximum
>>>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions