Zero-copy conversion between array objects compliant with the DLPack data exchange protocol.
array (object) – an array object that implements two methods:
a CuPy array that can be safely accessed on CuPy’s current stream.
- Return type
This function is different from CuPy’s legacy
fromDlpack()function. This function takes any object implementing the DLPack data exchange protocol, as well as a raw
PyCapsuleobject that contains the DLPack tensor as input (for backward compatibility), whereas
PyCapsuleobjects. If the input object is not compliant with the protocol, users are responsible to ensure data safety.