Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LayerNorm tester for gcc4.8 #30962

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions paddle/fluid/framework/ir/layer_norm_fuse_pass_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ class LayerNormFuseTest {
"division_out", "scale_out", "shift_out"},
{"sqr_pow", "eps", "gamma", "beta"})},
m_place{},
m_exe{m_place},
m_block_desc{m_prog.Block(0)} {
auto* x_var_desc = m_block_desc.FindVar("x");
m_exe{m_place} {
const BlockDesc& block_desc = m_prog.Block(0);
auto* x_var_desc = block_desc.FindVar("x");
x_var_desc->SetDataType(proto::VarType::FP32);
x_var_desc->SetShape({3, 32, 48});

auto* eps_var_desc = m_block_desc.FindVar("eps");
auto* eps_var_desc = block_desc.FindVar("eps");
eps_var_desc->SetDataType(proto::VarType::FP32);
eps_var_desc->SetShape({1});

auto* gamma_var_desc = m_block_desc.FindVar("gamma");
auto* gamma_var_desc = block_desc.FindVar("gamma");
gamma_var_desc->SetDataType(proto::VarType::FP32);
gamma_var_desc->SetShape({48});

auto* beta_var_desc = m_block_desc.FindVar("beta");
auto* beta_var_desc = block_desc.FindVar("beta");
beta_var_desc->SetDataType(proto::VarType::FP32);
beta_var_desc->SetShape({48});

Expand Down Expand Up @@ -102,7 +102,7 @@ class LayerNormFuseTest {
: LayerNormFuseTest() {
m_removed_nodes = removed_nodes;
m_added_nodes = added_nodes;
func(m_block_desc);
func(m_prog.Block(0));
}

void setupGraph() {
Expand Down Expand Up @@ -165,7 +165,6 @@ class LayerNormFuseTest {
ProgramDesc m_prog;
paddle::platform::CPUPlace m_place;
NaiveExecutor m_exe;
const BlockDesc& m_block_desc;
Scope m_scope;
std::unique_ptr<Graph> m_graph{nullptr};
};
Expand Down