From 53d563a0feb6b4ea17c3432de7736b7b3327c607 Mon Sep 17 00:00:00 2001 From: Sylwester Fraczek Date: Tue, 9 Jun 2020 15:24:17 +0200 Subject: [PATCH] Reshape transpose matmul coverage (#24970) * remove gmock from ut test=develop * coverage enabled for r+t+m fuse pass test=develop --- paddle/fluid/framework/ir/CMakeLists.txt | 4 +--- .../reshape_transpose_matmul_mkldnn_fuse_pass_tester.cc | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/paddle/fluid/framework/ir/CMakeLists.txt b/paddle/fluid/framework/ir/CMakeLists.txt index 2d7af7df59..70662e9f32 100644 --- a/paddle/fluid/framework/ir/CMakeLists.txt +++ b/paddle/fluid/framework/ir/CMakeLists.txt @@ -157,8 +157,6 @@ endif() cc_test(test_cpu_quantize_placement_pass SRCS mkldnn/cpu_quantize_placement_pass_tester.cc DEPS cpu_quantize_placement_pass) cc_test(test_cpu_quantize_pass SRCS mkldnn/cpu_quantize_pass_tester.cc DEPS cpu_quantize_pass naive_executor) cc_test(test_cpu_quantize_squash_pass SRCS mkldnn/cpu_quantize_squash_pass_tester.cc DEPS cpu_quantize_squash_pass naive_executor) - if(NOT WITH_COVERAGE) - cc_test(test_reshape_transpose_matmul_mkldnn_fuse_pass SRCS mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass_tester.cc DEPS reshape_transpose_matmul_mkldnn_fuse_pass) - endif() + cc_test(test_reshape_transpose_matmul_mkldnn_fuse_pass SRCS mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass_tester.cc DEPS reshape_transpose_matmul_mkldnn_fuse_pass) cc_test(test_matmul_transpose_reshape_fuse_pass SRCS mkldnn/matmul_transpose_reshape_fuse_pass_tester.cc DEPS matmul_transpose_reshape_fuse_pass) endif () diff --git a/paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass_tester.cc b/paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass_tester.cc index a9392b998a..e6c366efa0 100644 --- a/paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass_tester.cc +++ b/paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass_tester.cc @@ -14,7 +14,6 @@ #include "paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.h" -#include #include #include "paddle/fluid/framework/ir/pass_tester_helper.h" @@ -97,11 +96,11 @@ void TestMain(bool with_xshapes) { auto check = [&matmul_op_desc](std::string a) { std::string shape_str = "fused_reshape_" + a; - EXPECT_THAT(matmul_op_desc->GetAttrIfExists>(shape_str), - testing::ElementsAre(0, 0, 12, 64)); + auto shape = matmul_op_desc->GetAttrIfExists>(shape_str); + EXPECT_EQ(shape, (std::vector{0, 0, 12, 64})); std::string axis_str = "fused_transpose_" + a; - EXPECT_THAT(matmul_op_desc->GetAttrIfExists>(axis_str), - testing::ElementsAre(0, 2, 1, 3)); + auto axis = matmul_op_desc->GetAttrIfExists>(axis_str); + EXPECT_EQ(axis, (std::vector{0, 2, 1, 3})); }; check("X"); check("Y"); -- GitLab