to_dlpack

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

Return a dlpack tensor sharing the data.

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

PyCapsule – The dlpack tensor object.