MCPcopy
hub / github.com/apache/tvm / _args_to_device

Function _args_to_device

python/tvm/testing/runner.py:32–45  ·  view source on GitHub ↗
(args, device)

Source from the content-addressed store, hash-verified

30
31
32def _args_to_device(args, device):
33 import numpy as np
34
35 from tvm.runtime import Tensor, empty
36
37 uploaded_args = []
38 for arg in args:
39 if isinstance(arg, np.ndarray | Tensor):
40 uploaded_args.append(empty(arg.shape, dtype=arg.dtype, device=device).copyfrom(arg))
41 elif isinstance(arg, int | float):
42 uploaded_args.append(arg)
43 else:
44 raise ValueError(f"Unsupported input type: {type(arg)}")
45 return uploaded_args
46
47
48def _args_to_numpy(args):

Callers 2

local_runFunction · 0.85
rpc_runFunction · 0.85

Calls 3

emptyFunction · 0.90
copyfromMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…