1 from __future__
import absolute_import, division, print_function, unicode_literals
4 from torch._C import _from_dlpack
as from_dlpack
5 from torch._C import _to_dlpack
as to_dlpack
7 torch._C._add_docstr(from_dlpack,
r"""from_dlpack(dlpack) -> Tensor 9 Decodes a DLPack to a tensor. 12 dlpack: a PyCapsule object with the dltensor 14 The tensor will share the memory with the object represented 16 Note that each dlpack can only be consumed once. 19 torch._C._add_docstr(to_dlpack,
r"""to_dlpack(tensor) -> PyCapsule 21 Returns a DLPack representing the tensor. 24 tensor: a tensor to be exported 26 The dlpack shares the tensors memory. 27 Note that each dlpack can only be consumed once.