提交 d1b95ed9 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!5240 Fix remove internal output for unique device target

Merge pull request !5240 from YuJianfeng/internal_output
......@@ -58,7 +58,7 @@ const AnfNodePtr RemoveInternalOutput::Process(const FuncGraphPtr &func_graph, c
if (kernel_graph == nullptr) {
return nullptr;
}
if (!kernel_graph->IsInternalOutput(node, 0)) {
if (!kernel_graph->IsUniqueTargetInternalOutput(node, 0)) {
return nullptr;
}
if (!UsedForOutputOnly(func_graph, node)) {
......
......@@ -49,7 +49,7 @@ class TestHWRemoveInternalOutput : public BackendCommon {
auto make_tuple = GetMakeTuple(kg);
auto add = make_tuple->cast<CNodePtr>()->input(1);
MS_EXCEPTION_IF_NULL(add);
kg->AddInternalOutput(add, add);
kg->AddInternalOutput(add, add, 0, true);
KernelBuildInfoBuilder builder;
builder.SetInputsFormat({kOpFormat_DEFAULT, kOpFormat_DEFAULT});
builder.SetInputsDeviceType({kFloat32->type_id(), kFloat32->type_id()});
......@@ -77,8 +77,8 @@ class TestHWRemoveInternalOutput : public BackendCommon {
MS_EXCEPTION_IF_NULL(tuple_getitem2);
auto max_pool = tuple_getitem1->cast<CNodePtr>()->input(1);
MS_EXCEPTION_IF_NULL(max_pool);
kg->AddInternalOutput(tuple_getitem1, max_pool);
kg->AddInternalOutput(tuple_getitem2, max_pool);
kg->AddInternalOutput(tuple_getitem1, max_pool, 0, true);
kg->AddInternalOutput(tuple_getitem2, max_pool, 1, true);
KernelBuildInfoBuilder builder;
builder.SetInputsReshapeType({{}});
builder.SetOutputsReshapeType({{}, {}});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册