"to_dlpack" function or method.
Return type:
      Tensor
Examples:
  >>> import torch.utils.dlpack
  >>> t = torch.arange(4)

  # Convert a tensor directly (supported in PyTorch >= 1.10)
  >>> t2 = torch.from_dlpack(t)
  >>> t2[:2] = -1  # show that memory is shared
  >>> t2
  tensor([-1, -1,  2,  3])
  >>> t
  tensor([-1, -1,  2,  3])

  # The old-style DLPack usage, with an intermediate capsule object
  >>> capsule = torch.utils.dlpack.to_dlpack(t)
  >>> capsule
  <capsule object "dltensor" at ...>
  >>> t3 = torch.from_dlpack(capsule)
  >>> t3
  tensor([-1, -1,  2,  3])
  >>> t3[0] = -9  # now we're sharing memory between 3 tensors
  >>> t3
  tensor([-9, -1,  2,  3])
  >>> t2
  tensor([-9, -1,  2,  3])
  >>> t
  tensor([-9, -1,  2,  3])
