Skip to content

Commit 5c66d4a

Browse files
committed
update from upstream
1 parent 198c20c commit 5c66d4a

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

paddle/fluid/lite/core/mir/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ cc_test(test_pattern_matcher_lite SRCS pattern_matcher_tester.cc DEPS pattern_ma
5555
cc_library(pattern_matcher_high_api SRCS pattern_matcher_high_api.cc DEPS pattern_matcher_lite)
5656
cc_test(test_pattern_matcher_high_api SRCS pattern_matcher_high_api_test.cc DEPS
5757
pattern_matcher_high_api proto_desc mir_pass_manager fc_op_lite mul_op_lite elementwise_ops_lite
58-
mir_passes compatible_pb_lite ${ops_lite})
58+
mir_passes compatible_pb_lite model_parser_lite program_lite ${ops_lite})

paddle/fluid/lite/core/mir/pattern_matcher_high_api_test.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "paddle/fluid/lite/core/compatible_tensor.h"
2020
#include "paddle/fluid/lite/core/mir/graph_visualize_pass.h"
2121
#include "paddle/fluid/lite/core/mir/pattern_matcher_high_api.h"
22+
#include "paddle/fluid/lite/core/program.h"
23+
#include "paddle/fluid/lite/model_parser/model_parser.h"
2224

2325
namespace paddle {
2426
namespace lite {
@@ -128,7 +130,7 @@ TEST(pattern_matcher2, graph_test) {
128130
auto scope = std::make_shared<Scope>();
129131
auto graph = BuildGraph(&program_desc, scope, places);
130132

131-
ASSERT_EQ(graph->nodes().size(), 9UL);
133+
ASSERT_EQ(graph->nodes().size(), 8UL + 2UL /*feed op + fetch op*/);
132134
Visualize(graph.get());
133135
}
134136

@@ -139,7 +141,8 @@ TEST(pattern_matcher2, test) {
139141
auto graph = BuildGraph(&program_desc, scope, places);
140142
FcFuser fuser;
141143
fuser(graph.get());
142-
ASSERT_EQ(graph->nodes().size(), 9 - 3 + 1);
144+
ASSERT_EQ(graph->nodes().size(),
145+
8UL - 3UL /*mul_out, mul, add */ + 1UL /* fc*/);
143146
}
144147

145148
} // namespace mir

paddle/fluid/lite/core/mir/ssa_graph.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void SSAGraph::Build(const Program &program,
139139
GraphCreateWeightVarNodes(program);
140140
CHECK(CheckNodesRoleSet());
141141

142-
for (auto &op : program.ops) {
142+
for (auto &op : program.ops()) {
143143
auto *op_node = GraphCreateInstructNode(op, valid_places);
144144
for (const std::string &name : op->op_info()->input_names()) {
145145
auto *arg = Argument(name);

0 commit comments

Comments
 (0)