Browse Source

change the error type in Infer from ValueError to TypeError

tags/v0.3.0-alpha
simson 6 years ago
parent
commit
16e57a4062
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      mindspore/ccsrc/pipeline/static_analysis/evaluator.cc

+ 3
- 3
mindspore/ccsrc/pipeline/static_analysis/evaluator.cc View File

@@ -93,9 +93,9 @@ AbstractBasePtr BaseFuncGraphEvaluator::Infer(AnalysisEnginePtr engine, const Ab
MS_EXCEPTION_IF_NULL(fg);
std::size_t nargs = fg->parameters().size();
if (args_spec_list.size() != nargs) {
MS_EXCEPTION(ValueError) << "Function " << fg->ToString() << ", The number of parameters of this function is "
<< fg->parameters().size() << ", but the number of provided arguments is "
<< args_spec_list.size() << ". NodeInfo: " << trace::GetDebugInfo(fg->debug_info());
MS_EXCEPTION(TypeError) << "Function " << fg->ToString() << ", The number of parameters of this function is "
<< fg->parameters().size() << ", but the number of provided arguments is "
<< args_spec_list.size() << ". NodeInfo: " << trace::GetDebugInfo(fg->debug_info());
}
MS_EXCEPTION_IF_NULL(parent_context_);
MS_EXCEPTION_IF_NULL(engine);


Loading…
Cancel
Save