!12205 fix bug of reformat in pynative

From: @lianliguang
Reviewed-by: @kisnwang,@zhoufeng54,@chujinjin
Signed-off-by: @chujinjin
pull/12205/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit d13c2afc36

@ -370,6 +370,9 @@ void KernelGraph::CheckLoop() {
void ReSetParameterValueNodeFormatAndType(const AnfNodePtr &node, const std::string &format) {
MS_EXCEPTION_IF_NULL(node);
if (AnfAlgo::OutputAddrExist(node, 0)) {
return;
}
auto kernel_build_info_builder = std::make_shared<kernel::KernelBuildInfo::KernelBuildInfoBuilder>();
MS_EXCEPTION_IF_NULL(kernel_build_info_builder);
kernel_build_info_builder->SetOutputsFormat({format});

@ -1776,9 +1776,6 @@ void SessionBasic::RunInfer(NotNull<FuncGraphPtr> func_graph, const std::vector<
MS_EXCEPTION_IF_NULL(prim_c);
auto abstract = prim_c->Infer(input_abstracts);
node->set_abstract(abstract);
} else {
node->set_abstract(
std::make_shared<tensor::Tensor>(kNumberTypeFloat32, std::vector<int64_t>{32, 64, 218, 218})->ToAbstract());
}
} else if (node->isa<Parameter>()) {
if (tensor_index > inputs.size()) {

Loading…
Cancel
Save