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

Method set_input

python/tvm/runtime/vm.py:250–276  ·  view source on GitHub ↗

Set the inputs to a function. This interface works when using VM over RPC by internally converting Tensor in the arguments to DLTensor, which is supported in RPC where remote could only have a minimal C runtime. Note: If `set_input` is used, the function *must* be ca

(self, func_name: str, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

248 return new_args
249
250 def set_input(self, func_name: str, *args: Any, **kwargs: Any) -> None:
251 """Set the inputs to a function.
252 This interface works when using VM over RPC by internally converting Tensor in
253 the arguments to DLTensor, which is supported in RPC where remote could only
254 have a minimal C runtime.
255
256 Note: If `set_input` is used, the function *must* be called using `invoke_stateful`
257 and the results must be obtained using `get_outputs`.
258
259 Parameters
260 ----------
261 func_name : str
262 The name of the function.
263 args: List[tvm.runtime.Tensor] or List[np.ndarray]
264 The arguments to the function.
265 kwargs: dict of str to tvm.runtime.Tensor or np.ndarray
266 Named arguments to the function.
267 """
268 cargs: list[Any] = []
269
270 if kwargs:
271 args = self._convert_func_named_args(func_name, args, **kwargs)
272
273 for arg in args:
274 self._convert(arg, cargs)
275
276 self._set_input(func_name, *cargs)
277
278 def invoke_stateful(self, func_name: str) -> None:
279 """

Callers 15

check_correctnessFunction · 0.95
get_vm_resFunction · 0.95
check_correctnessFunction · 0.95
run_in_tvmFunction · 0.95
test_nmsFunction · 0.95
test_nms_iou_suppressionFunction · 0.95
test_nms_max_boxes_limitFunction · 0.95
test_nms_score_thresholdFunction · 0.95
test_time_evaluatorFunction · 0.95

Calls 2

_convertMethod · 0.95

Tested by 15

check_correctnessFunction · 0.76
get_vm_resFunction · 0.76
check_correctnessFunction · 0.76
run_in_tvmFunction · 0.76
test_nmsFunction · 0.76
test_nms_iou_suppressionFunction · 0.76
test_nms_max_boxes_limitFunction · 0.76
test_nms_score_thresholdFunction · 0.76
test_time_evaluatorFunction · 0.76