Skip to content

Commit

Permalink
fix case
Browse files Browse the repository at this point in the history
Signed-off-by: fishbell <[email protected]>
  • Loading branch information
songbell committed Dec 25, 2024
1 parent 293a707 commit 68ba5b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,18 @@ void reshape_transfer::run(program& p) {
is_suitable_parent = [&is_suitable_parent](const cldnn::program_node* node) -> bool {
if (node->get_users().size() != 1 || node->is_dynamic())
return false;
if (node->is_type<convolution>())
return true;
if (node->is_type<reorder>()) {
for (size_t idx = 0; idx < node->get_dependencies().size(); idx++) {
auto& input = node->get_dependency(idx);
if (!input.is_in_data_flow() || input.is_constant())
continue;
if (input.is_type<convolution>()) {
return true;
} else if (input.is_type<eltwise>() && input.get_dependency(1).is_constant()) {
return is_suitable_parent(&input);
} else if (input.is_type<activation>()) {
return is_suitable_parent(&input);
}
return false;
for (size_t idx = 0; idx < node->get_dependencies().size(); idx++) {
auto& input = node->get_dependency(idx);
if (!input.is_in_data_flow() || input.is_constant())
continue;
if (node->is_type<convolution>() || input.is_type<convolution>()) {
return true;
} else if (input.is_type<eltwise>() && input.get_dependency(1).is_constant()) {
return is_suitable_parent(&input);
} else if (input.is_type<activation>()) {
return is_suitable_parent(&input);
}
return false;
}
return false;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,8 @@ TEST(opt_reorder_reshape_permute, not_sinking_reshape) {

net.set_input_data("input", input);
auto output = net.execute();
auto optimzed_nodes = net.get_program()->get_optimized();
auto it =
std::find_if(std::begin(optimzed_nodes), std::end(optimzed_nodes), [&](cldnn::program::optimized_info& oi) {
return oi.first == "reorder_inter";
});
ASSERT_NE(it, optimzed_nodes.end());
auto permute_inst = net.get_primitive("permute_inter");
ASSERT_FALSE(permute_inst->can_be_optimized());
auto reshape_inst = net.get_primitive("reshape_inter");
ASSERT_FALSE(reshape_inst->can_be_optimized());

auto& processing_order = prog->get_processing_order();

Expand All @@ -365,7 +357,6 @@ TEST(opt_reorder_reshape_permute, not_sinking_reshape) {
mem_lock<ov::float16> lock_ref(ref_out_mem, get_test_stream());
for (size_t i = 0; i < out_mem->count(); i++) {
float actual = lock[i];
std::cout << actual << ", " << std::endl;
ASSERT_EQ(actual, lock_ref[i]);
}
}

0 comments on commit 68ba5b1

Please sign in to comment.