From c594e3d4a9114ee45bf005ef20dac68cf0cf085f Mon Sep 17 00:00:00 2001
From: chujinjin <chujinjin52@huawei.com>
Date: Thu, 27 Aug 2020 20:43:34 +0800
Subject: [PATCH] fix load input data error when input is a tuple

---
 mindspore/ccsrc/backend/session/gpu_session.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mindspore/ccsrc/backend/session/gpu_session.cc b/mindspore/ccsrc/backend/session/gpu_session.cc
index d4475da1c..037780a8c 100644
--- a/mindspore/ccsrc/backend/session/gpu_session.cc
+++ b/mindspore/ccsrc/backend/session/gpu_session.cc
@@ -133,7 +133,11 @@ void GPUSession::LoadInputData(const std::shared_ptr<KernelGraph> &kernel_graph,
                                const std::vector<tensor::TensorPtr> &inputs_const) const {
   std::vector<tensor::TensorPtr> inputs(inputs_const);
   MS_EXCEPTION_IF_NULL(kernel_graph);
-  auto input_nodes = kernel_graph->inputs();
+  std::vector<AnfNodePtr> input_nodes;
+  for (const auto &input_node : kernel_graph->inputs()) {
+    auto params = AnfAlgo::GetAllOutput(input_node);
+    std::copy(params.begin(), params.end(), std::back_inserter(input_nodes));
+  }
   auto ms_context = MsContext::GetInstance();
   MS_EXCEPTION_IF_NULL(ms_context);
   if (inputs.size() != input_nodes.size()) {
-- 
GitLab