| 3545 | } |
| 3546 | |
| 3547 | Status MklLayoutRewritePass::MergeNode(std::unique_ptr<Graph>* g, Node* m, |
| 3548 | Node* n) { |
| 3549 | CHECK_NOTNULL(m); |
| 3550 | CHECK_NOTNULL(n); |
| 3551 | |
| 3552 | if (((m->type_string() == csinfo_.bias_add && |
| 3553 | n->type_string() == csinfo_.conv2d)) || |
| 3554 | ((n->type_string() == csinfo_.bias_add && |
| 3555 | m->type_string() == csinfo_.conv2d))) { |
| 3556 | return this->MergeConv2DWithBiasAdd(g, m, n); |
| 3557 | } |
| 3558 | if ((m->type_string() == csinfo_.pad && |
| 3559 | (n->type_string() == csinfo_.conv2d || |
| 3560 | (n->type_string() == csinfo_.fused_conv2d && FusedConv2DRewrite(n)))) || |
| 3561 | (n->type_string() == csinfo_.pad && |
| 3562 | (m->type_string() == csinfo_.conv2d || |
| 3563 | (m->type_string() == csinfo_.fused_conv2d && FusedConv2DRewrite(m))))) { |
| 3564 | return this->MergePadWithConv2D(g, m, n); |
| 3565 | } |
| 3566 | |
| 3567 | if (((m->type_string() == csinfo_.bias_add_grad && |
| 3568 | n->type_string() == csinfo_.conv2d_grad_filter)) || |
| 3569 | ((n->type_string() == csinfo_.bias_add_grad && |
| 3570 | m->type_string() == csinfo_.conv2d_grad_filter))) { |
| 3571 | return this->MergeConv2DBackpropFilterWithBiasAddGrad(g, m, n); |
| 3572 | } |
| 3573 | |
| 3574 | return Status(error::Code::UNIMPLEMENTED, |
| 3575 | "Unimplemented case for node merge optimization."); |
| 3576 | } |
| 3577 | |
| 3578 | ////////////////////////////////////////////////////////////////////////// |
| 3579 | // Helper functions for node rewrite |
nothing calls this directly
no test coverage detected