()
| 559 | |
| 560 | |
| 561 | def test_two_cbr(): |
| 562 | with PatternContext() as ctx: |
| 563 | cbr0 = ( |
| 564 | is_call_dps_packed("conv1x1") |
| 565 | >> is_call_dps_packed("bias_add") |
| 566 | >> is_call_dps_packed("my_relu") |
| 567 | ) |
| 568 | cbr1 = cbr0.dup() |
| 569 | |
| 570 | assert cbr0.patterns[0] != cbr1.patterns[0] |
| 571 | assert cbr0.patterns[1] != cbr1.patterns[1] |
| 572 | assert cbr0.patterns[2] != cbr1.patterns[2] |
| 573 | |
| 574 | is_var("x").fork_to(cbr0, cbr1) |
| 575 | dfb = CBRx2["main"].body.blocks[0] |
| 576 | assert ctx.match_dfb(dfb) |
| 577 | |
| 578 | with PatternContext() as ctx: |
| 579 | # Deny the pattern |
| 580 | cbr0 = ( |
| 581 | is_call_dps_packed("conv1x1") |
| 582 | >> is_call_dps_packed("bias_add") |
| 583 | >> is_call_dps_packed("my_relu") |
| 584 | ) |
| 585 | cbr1 = cbr0.dup() |
| 586 | |
| 587 | # input has no fork at y. |
| 588 | is_var("y").fork_to(cbr0, cbr1) |
| 589 | dfb = CBRx2["main"].body.blocks[0] |
| 590 | assert not ctx.match_dfb(dfb) |
| 591 | |
| 592 | |
| 593 | def test_two_matmul(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…