!5985 fix parallel optimizer problem, assign is removed unexpectly

Merge pull request !5985 from gziyan/fix_parallel_optimizer
This commit is contained in:
mindspore-ci-bot 2020-09-10 18:37:21 +08:00 committed by Gitee
commit c7ff3bd7ed
1 changed files with 6 additions and 1 deletions

View File

@ -636,7 +636,12 @@ AbstractBasePtr InferImplAssign(const AnalysisEnginePtr &, const PrimitivePtr &p
CheckArgsSize(primitive->name(), args_spec_list, 2);
MS_LOG(DEBUG) << "InferImplAssign " << args_spec_list[0];
return args_spec_list[0];
auto type = args_spec_list[0]->BuildType();
if (type->type_id() == kObjectTypeRefKey) {
return args_spec_list[1]->Broaden();
} else {
return args_spec_list[0];
}
}
REGISTER_FRONTENT_PRIMITIVE_EVAL_IMPL(TypeOf, prim::kPrimTypeOf, InferImplTypeof);