You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by zh...@apache.org on 2020/07/09 04:52:36 UTC

[incubator-tvm] branch master updated: [RUNTIME] if a param not in input, we still consume it's data (#5990)

This is an automated email from the ASF dual-hosted git repository.

zhic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
     new 09a30f4  [RUNTIME] if a param not in input, we still consume it's data (#5990)
09a30f4 is described below

commit 09a30f4a960df5de06748a60d57a7b34b91166c9
Author: windclarion <wi...@gmail.com>
AuthorDate: Thu Jul 9 12:52:24 2020 +0800

    [RUNTIME] if a param not in input, we still consume it's data (#5990)
    
    so the read pointer of stream can move forward
    
    Signed-off-by: windclarion <wi...@gmail.com>
---
 src/runtime/graph/graph_runtime.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/runtime/graph/graph_runtime.cc b/src/runtime/graph/graph_runtime.cc
index 146c097..e984861 100644
--- a/src/runtime/graph/graph_runtime.cc
+++ b/src/runtime/graph/graph_runtime.cc
@@ -198,7 +198,11 @@ void GraphRuntime::LoadParams(dmlc::Stream* strm) {
   CHECK(size == names.size()) << "Invalid parameters file format";
   for (size_t i = 0; i < size; ++i) {
     int in_idx = GetInputIndex(names[i]);
-    if (in_idx < 0) continue;
+    if (in_idx < 0) {
+      NDArray temp;
+      temp.Load(strm);
+      continue;
+    }
     uint32_t eid = this->entry_id(input_nodes_[in_idx], 0);
     CHECK_LT(eid, data_entry_.size());