/usr/local/lib64/python3.6/site-packages/torch/utils/__pycache__
NameSizeModeActions
bundled_inputs.cpython-36.pyc169270644editdlrm
checkpoint.cpython-36.pyc103970644editdlrm
collect_env.cpython-36.pyc133170644editdlrm
cpp_extension.cpython-36.pyc595840644editdlrm
dlpack.cpython-36.pyc18940644editdlrm
file_baton.cpython-36.pyc18240644editdlrm
hooks.cpython-36.pyc72570644editdlrm
mkldnn.cpython-36.pyc67220644editdlrm
mobile_optimizer.cpython-36.pyc47480644editdlrm
model_zoo.cpython-36.pyc2310644editdlrm
show_pickle.cpython-36.pyc48280644editdlrm
throughput_benchmark.cpython-36.pyc67300644editdlrm
_cpp_extension_versioner.cpython-36.pyc17680644editdlrm
_crash_handler.cpython-36.pyc10050644editdlrm
_python_dispatch.cpython-36.pyc7800644editdlrm
_pytree.cpython-36.pyc67470644editdlrm
__init__.cpython-36.pyc7300644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/utils/__pycache__/dlpack.cpython-36.pyc (1894B)
3 Eg@sjddlmZddlZddlZddlmZddlmZGdddejZ ej j edeej dd d Z dS) )AnyN) _from_dlpack) _to_dlpackc@s0eZdZd Zd Zd ZdZdZdZdZ dZ dZ d S) DLDeviceType N)r)r)r)r )r )r )r )r )r) __name__ __module__ __qualname__ZkDLCPUkDLGPUZ kDLCPUPinnedZ kDLOpenCLZ kDLVulkanZkDLMetalZkDLVPIkDLROCMZ kDLExtDevrr>/usr/local/lib64/python3.6/site-packages/torch/utils/dlpack.pyr srzto_dlpack(tensor) -> PyCapsule Returns a DLPack representing the tensor. Args: tensor: a tensor to be exported The DLPack shares the tensors memory. Note that each DLPack can only be consumed once. ) ext_tensorreturncCsbt|drV|j}|dtjtjfkrLtjjdj|d}|j |j d}qZ|j }n|}t |S)afrom_dlpack(ext_tensor) -> Tensor Convers a tensor from a external library into a ``torch.Tensor`` by means of the ``__dlpack__`` protocol. The tensor will share the memory with the object represented in the DLPack. .. warning:: Only call from_dlpack once per capsule. Its behavior when used on the same capsule multiple times is undefined. Args: ext_tensor (object with __dlpack__ attribute or DLPack capsule): The tensor or DLPack capsule to convert. __dlpack__rzcuda:{}r)stream) hasattrZ__dlpack_device__rrrtorchZcudaZcurrent_streamformatrZ cuda_streamr)rZdevicerZdlpackrrr from_dlpack$s  r)typingrrenumZtorch._CrrZ to_dlpackIntEnumr_CZ _add_docstrZTensorrrrrrs