From a4b4343f202021a87ee94807162baaf0643ad75a Mon Sep 17 00:00:00 2001 From: zyfncg Date: Fri, 30 Dec 2022 16:23:03 +0800 Subject: [PATCH] Fix test_conv_bn_fuse_pass_cc on Windows System (#49446) * fix test_conv_bn_fuse_pass_cc * remove comment --- paddle/fluid/framework/ir/conv_bn_fuse_pass_tester.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 324f707af1..021d372c2c 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() { -- GitLab