未验证 提交 7b4916c4 编写于 作者: L Leo Chen 提交者: GitHub

[pten] fix wrong variable name in PreparePtenData (#39311)

上级 09198b04
...@@ -1877,6 +1877,7 @@ Scope* OperatorWithKernel::PreparePtenData( ...@@ -1877,6 +1877,7 @@ Scope* OperatorWithKernel::PreparePtenData(
"the size of kernel input_defs (%d).", "the size of kernel input_defs (%d).",
input_names.size(), input_defs.size())); input_names.size(), input_defs.size()));
Scope* new_scope = nullptr; Scope* new_scope = nullptr;
auto& name_map = Inputs();
const std::unordered_set<std::string>* no_buffer_ins = nullptr; const std::unordered_set<std::string>* no_buffer_ins = nullptr;
if (info_) { if (info_) {
auto& no_buffer_inferer = info_->NoNeedBufferVarsInferer(); auto& no_buffer_inferer = info_->NoNeedBufferVarsInferer();
...@@ -1890,6 +1891,7 @@ Scope* OperatorWithKernel::PreparePtenData( ...@@ -1890,6 +1891,7 @@ Scope* OperatorWithKernel::PreparePtenData(
for (size_t i = 0; i < input_defs.size(); ++i) { for (size_t i = 0; i < input_defs.size(); ++i) {
auto& in_def = input_defs.at(i); auto& in_def = input_defs.at(i);
auto& ins_vector = ctx->inputs.at(input_names[i]); auto& ins_vector = ctx->inputs.at(input_names[i]);
auto& name_vec = name_map.at(input_names[i]);
bool should_skip_input = bool should_skip_input =
no_buffer_ins && no_buffer_ins->count(input_names[i]) > 0; no_buffer_ins && no_buffer_ins->count(input_names[i]) > 0;
...@@ -1927,7 +1929,7 @@ Scope* OperatorWithKernel::PreparePtenData( ...@@ -1927,7 +1929,7 @@ Scope* OperatorWithKernel::PreparePtenData(
} }
// Create new var with the same name in transfer scopes // Create new var with the same name in transfer scopes
auto* trans_var = new_scope->Var(input_names[i]); auto* trans_var = new_scope->Var(name_vec[offset]);
ins_vector[offset] = trans_var; ins_vector[offset] = trans_var;
// Do transfer // Do transfer
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册