MCPcopy Index your code
hub / github.com/apache/tvm / _convert_tvm_to_pytorch

Method _convert_tvm_to_pytorch

python/tvm/relax/base_py_module.py:420–426  ·  view source on GitHub ↗

Convert TVM Tensors to PyTorch tensors using DLPack.

(
        self, tvm_tensors: Any | list[Any]
    )

Source from the content-addressed store, hash-verified

418 ) from error
419
420 def _convert_tvm_to_pytorch(
421 self, tvm_tensors: Any | list[Any]
422 ) -> Union["torch.Tensor", list["torch.Tensor"]]:
423 """Convert TVM Tensors to PyTorch tensors using DLPack."""
424 if isinstance(tvm_tensors, list | tuple):
425 return [self._convert_single_tvm_to_pytorch(tensor) for tensor in tvm_tensors]
426 return self._convert_single_tvm_to_pytorch(tvm_tensors)
427
428 def _convert_single_tvm_to_pytorch(self, tvm_tensor: Any) -> "torch.Tensor":
429 """Convert a single TVM Tensor to PyTorch tensor using faster DLPack converter."""

Callers 11

wrapperMethod · 0.95
call_tirMethod · 0.95
addMethod · 0.80
multiplyMethod · 0.80
ml_pipelineMethod · 0.80
data_preprocessingMethod · 0.80
vectorized_operationMethod · 0.80
sklearn_integrationMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80

Calls 1

Tested by 6

addMethod · 0.64
multiplyMethod · 0.64
ml_pipelineMethod · 0.64
data_preprocessingMethod · 0.64
vectorized_operationMethod · 0.64
sklearn_integrationMethod · 0.64