transformat optimize

pull/6978/head
zhengjun10 5 years ago
parent e7a5f31cee
commit bd9d63861d

@ -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