From 09a30f4a960df5de06748a60d57a7b34b91166c9 Mon Sep 17 00:00:00 2001 From: windclarion Date: Thu, 9 Jul 2020 12:52:24 +0800 Subject: [PATCH] [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 --- 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()); -- 2.7.4