to_dlpack

dragon.dlpack.to_dlpack(
  tensor,
  readonly=True
)[source]

Return a dlpack tensor sharing the data.

Parameters:
  • tensor (tensor_like) – The tensor to provide data.
  • readonly (bool, optional, default=True) – False to sync the content with device.
Returns:

PyCapsule – The dlpack tensor object.