Browse Source

!1650 Update error report.

From: @zhao_zhixuan
Reviewed-by: @wqtshg,@ji_chen
Signed-off-by: @ji_chen
tags/v1.3.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
838e3b1098
2 changed files with 19 additions and 1 deletions
  1. +4
    -1
      ge/graph/manager/graph_manager.cc
  2. +15
    -0
      tests/ut/ge/graph/manager/graph_manager_unittest.cc

+ 4
- 1
ge/graph/manager/graph_manager.cc View File

@@ -108,6 +108,7 @@
#include "common/formats/utils/formats_trans_utils.h"
#include "register/custom_pass_helper.h"
#include "external/graph/types.h"
#include "common/util/error_manager/error_manager.h"

namespace {
const char *const kSummary = "Summary";
@@ -492,7 +493,9 @@ Status GraphManager::ModifyDataIndex(const Graph &graph, const std::map<std::str
auto iter = graph_option.find(OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE);
if (iter != graph_option.end() && !iter->second.empty()) {
// If data inputs shape range is set, user must set valid data index.
REPORT_INNER_ERROR("E19999", "Input data index is invalid when data shape range enabled, please check!");
std::string failed_reason = "Data index must be set continuous from 0 when data shape range enabled!";
REPORT_INPUT_ERROR("E10003", std::vector<std::string>({"parameter", "value", "reason"}),
std::vector<std::string>({"--data_index", "-", failed_reason}));
GELOGE(GRAPH_PARAM_INVALID, "[COMP][AddGraph]Input data index is invalid when data shape range enabled.");
return GRAPH_PARAM_INVALID;
}


+ 15
- 0
tests/ut/ge/graph/manager/graph_manager_unittest.cc View File

@@ -221,6 +221,21 @@ TEST_F(UtestGraphManagerTest, test_add_graph_4) {
EXPECT_NE(status, ge::SUCCESS);
}

TEST_F(UtestGraphManagerTest, test_add_graph_5) {
Graph graph("test_graph");
auto data = op::Data("Data").set_attr_index(1);
auto flatten = op::Flatten("Flatten").set_input_x(data, data.name_out_out());
std::vector<Operator> inputs{data};
std::vector<Operator> outputs{flatten};
graph.SetInputs(inputs).SetOutputs(outputs);

std::map<std::string, std::string> options = {{"ge.exec.dataInputsShapeRange", "0:[-1]"}};
OmgContext context;
GraphId graph_id = 1;
GraphManager graph_manager;
EXPECT_EQ(graph_manager.AddGraph(graph_id, graph, options, context), GRAPH_PARAM_INVALID);
}

TEST_F(UtestGraphManagerTest, test_add_graph_with_copy_1) {
GraphId graph_id = 1;
GraphManager graph_manager;


Loading…
Cancel
Save