huajsj commented on a change in pull request #9494:
URL: https://github.com/apache/tvm/pull/9494#discussion_r748032646
##########
File path: python/tvm/contrib/pipeline_executor.py
##########
@@ -93,8 +108,71 @@ def __init__(self, module):
else:
self.module = module
# Get the packed functions from the pipeline executor.
+ self._run = self.module["run"]
+ self._stop = self.module["stop"]
+ self._set_input = self.module["set_input"]
+ self._set_param = self.module["set_param"]
+ self._get_input = self.module["get_input"]
+ self._get_output = self.module["get_output"]
+ self._get_num_inputs = self.module["get_num_inputs"]
self._get_num_outputs = self.module["get_num_outputs"]
+ def run(self, sync=False):
+ """Run the pipeline executor."""
+ self._run(sync)
+
+ def stop(self):
+ """Stop the pipeline executor."""
+ self._stop()
+
+ def set_input(self, key, value):
+ """Set inputs to the module via "value".
+ Parameters
+ ----------
+ key : str
+ The input key
+
+ value : array_like.
+ The input value
+ """
+ self._set_input(key, tvm.nd.array(value, tvm.cpu()))
Review comment:
fixed, removed the cpu target binding, and use NDArray.copyfrom to
handle NDArray and non-NDArray issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]