(args, device)
| 30 | |
| 31 | |
| 32 | def _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 | |
| 48 | def _args_to_numpy(args): |