Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericmjl/4234935dd5f06f34640ef9696f623550 to your computer and use it in GitHub Desktop.
Save ericmjl/4234935dd5f06f34640ef9696f623550 to your computer and use it in GitHub Desktop.
CuPy arrays have shapes but cupy doesn't have shape()
In [1]: import cupy as cp
In [2]: a = cp.array([1, 2, 3])
In [3]: cp.shape(a)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-e2f1392629a9> in <module>()
----> 1 cp.shape(a)
AttributeError: module 'cupy' has no attribute 'shape'
In [4]: a.shape
Out[4]: (3,)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment