[RUNTIME] if a param not in input, we still consume it's data (#5990)
authorwindclarion <windclarion@gmail.com>
Thu, 9 Jul 2020 04:52:24 +0000 (12:52 +0800)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2020 04:52:24 +0000 (21:52 -0700)
so the read pointer of stream can move forward

Signed-off-by: windclarion <windclarion@gmail.com>
src/runtime/graph/graph_runtime.cc

index 146c097..e984861 100644 (file)
@@ -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());