mehrdadh commented on a change in pull request #7903:
URL: https://github.com/apache/tvm/pull/7903#discussion_r621408161



##########
File path: src/runtime/graph_executor/debug/graph_executor_debug.cc
##########
@@ -207,6 +200,42 @@ class GraphExecutorDebug : public GraphExecutor {
     return -1;
   }
 
+  /*!
+   * \brief Get number of outputs of the node.
+   * \param index The index of the node.
+   * \return The number of outputs.
+   */
+  size_t NodeGetNumOutputs(size_t index) {
+    if (nodes_[index].op_type != "tvm_op") return 1;
+    return static_cast<size_t>(nodes_[index].param.num_outputs);
+  }
+
+  /*!
+   * \brief Execute next node in the network.
+   *
+   * This method will execute next node assuming
+   * previous nodes has been executed and return output of index-th node.
+   *
+   * \param node_ind: The index of the node.
+   * \param output_ind: The output index of this node.
+   * \return Node outputs array.
+   */
+  NDArray ExecuteNextNodeGetOutputs(int node_ind, int output_ind) {
+    ICHECK_LT(static_cast<size_t>(node_ind), op_execs_.size());
+
+    // Reset execution.
+    if (node_ind < 0) {
+      last_executed_node_ = -1;
+      return NDArray();
+    }
+
+    if (node_ind > last_executed_node_) {

Review comment:
       thanks for the feedbacks!
   I divided this PackedFunc to two functions as @areusch suggested.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to