!6978 [MSLITE] transformat optimize for leaky_relu

Merge pull request !6978 from zhengjun10/master
pull/6978/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 8b4cdc1523

@ -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();
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) {
can_fusion = has_trans_count > half_count;
} else {

Loading…
Cancel
Save