!4722 modiy error type

Merge pull request !4722 from lijiaqi/modify_error_type
This commit is contained in:
mindspore-ci-bot 2020-08-19 16:18:50 +08:00 committed by Gitee
commit 70a218123b
2 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ AnfNodePtr ResolveSymbol(const FuncGraphManagerPtr &manager, const NameSpacePtr
}
SymbolResolver symbol_resolver(name_space, symbol, node);
if (!symbol_resolver.Resolve()) {
MS_LOG(EXCEPTION) << "Parse Resolve node failed NodeInfo: " << trace::GetDebugInfo(node->debug_info());
MS_EXCEPTION(TypeError) << "Parse Resolve node failed NodeInfo: " << trace::GetDebugInfo(node->debug_info());
}
py::object obj = symbol_resolver.result();

View File

@ -162,7 +162,7 @@ def test_sequential_resolve_error():
input_np = np.random.randn(2, 3, 4, 5).astype(np.float32)
input_me = Tensor(input_np)
net = SequenceNet()
with pytest.raises(RuntimeError):
with pytest.raises(TypeError):
net(input_me)