diff --git a/paddle/fluid/framework/ir/conv_bn_fuse_pass_tester.cc b/paddle/fluid/framework/ir/conv_bn_fuse_pass_tester.cc index 324f707af1ec5d9e1a9a6fcc2d4704026e84df2c..021d372c2c89aa64863b8731430360e923285720 100644 --- a/paddle/fluid/framework/ir/conv_bn_fuse_pass_tester.cc +++ b/paddle/fluid/framework/ir/conv_bn_fuse_pass_tester.cc @@ -32,7 +32,11 @@ void AddVarToScope(Scope* param_scope, const DDim& dims) { auto* tensor = param_scope->Var(name)->GetMutable(); tensor->Resize(dims); - tensor->mutable_data(platform::CPUPlace()); + auto* data = tensor->mutable_data(platform::CPUPlace()); + int64_t numel = tensor->numel(); + for (int64_t i = 0; i < numel; ++i) { + data[i] = 0; + } } Scope* CreateParamScope() {