From 758853ff52d47aac2d288edf60c97236a3acc21e Mon Sep 17 00:00:00 2001 From: changzherui Date: Tue, 28 Jul 2020 23:30:17 +0800 Subject: [PATCH] modify case --- mindspore/ccsrc/transform/graph_ir/convert.cc | 4 +++- tests/ut/python/automl/{case.py => test_case.py} | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) rename tests/ut/python/automl/{case.py => test_case.py} (96%) diff --git a/mindspore/ccsrc/transform/graph_ir/convert.cc b/mindspore/ccsrc/transform/graph_ir/convert.cc index 74de7eae6..3f6d41804 100644 --- a/mindspore/ccsrc/transform/graph_ir/convert.cc +++ b/mindspore/ccsrc/transform/graph_ir/convert.cc @@ -1342,9 +1342,11 @@ void DfGraphConvertor::SetOpInput(const OpAdapterPtr &adpt, const CNodePtr &node } for (size_t i = 1; i < input_size; i++) { - auto pred = inputs[i]; + AnfNodePtr pred = nullptr; if (case_flag != 0) { pred = case_input_handle_cache_[node.get()]->at(i - 1); + } else { + pred = inputs[i]; } while (pred->isa() && GetCNodeTargetFuncName(pred->cast()) == "Depend") { diff --git a/tests/ut/python/automl/case.py b/tests/ut/python/automl/test_case.py similarity index 96% rename from tests/ut/python/automl/case.py rename to tests/ut/python/automl/test_case.py index 745376277..39bcebca0 100644 --- a/tests/ut/python/automl/case.py +++ b/tests/ut/python/automl/test_case.py @@ -29,8 +29,7 @@ class Net(nn.Cell): def construct(self, x, index): x = self.layers[index](x) - y = self.conv1(x) - return x + y + return 2 + x def test_case(): -- GitLab