Browse Source

transformat optimize

tags/v1.1.0
zhengjun10 5 years ago
parent
commit
bd9d63861d
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_insert_pass.cc

+ 5
- 0
mindspore/lite/tools/converter/legacy_optimizer/graph/trans_format_insert_pass.cc View File

@@ -88,6 +88,11 @@ bool TransOpInsertPass::CanFusion(schema::MetaGraphT *graph, const std::unique_p
} }
auto total_node_count = input_node_indexes.size() + output_node_indexes.size(); auto total_node_count = input_node_indexes.size() + output_node_indexes.size();
size_t half_count = total_node_count / 2; size_t half_count = total_node_count / 2;
if (GetCNodeTType(*node) == schema::PrimitiveType_Activation) {
if (node->primitive->value.AsActivation()->type == schema::ActivationType_LEAKY_RELU) {
return has_trans_count >= half_count;
}
}
if (total_node_count % 2 == 0) { if (total_node_count % 2 == 0) {
can_fusion = has_trans_count > half_count; can_fusion = has_trans_count > half_count;
} else { } else {


Loading…
Cancel
Save