cupy.from_dlpack#
- cupy.from_dlpack(array, *, device=None, copy=None)#
Zero-copy conversion between array objects compliant with the DLPack data exchange protocol.
- Parameters:
- Returns:
a CuPy array that can be safely accessed on CuPy’s current stream.
- Return type:
Note
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 rawPyCapsuleobject that contains the DLPack tensor as input (for backward compatibility), whereasfromDlpack()only acceptsPyCapsuleobjects. If the input object is not compliant with the protocol, users are responsible to ensure data safety.