()
| 539 | |
| 540 | |
| 541 | def test_nested_context(): |
| 542 | dfb = CBRx2["main"].body.blocks[0] |
| 543 | with PatternContext() as ctx0: |
| 544 | ( |
| 545 | is_call_dps_packed("conv1x1") |
| 546 | >> is_call_dps_packed("bias_add") |
| 547 | >> is_call_dps_packed("my_relu") |
| 548 | ) |
| 549 | with PatternContext() as ctx1: |
| 550 | is_call_dps_packed("conv1x1") >> is_call_dps_packed("my_relu") # pattern to miss |
| 551 | with PatternContext() as ctx2: |
| 552 | is_call_dps_packed("bias_add") >> is_call_dps_packed("my_relu") |
| 553 | assert ctx2.match_dfb(dfb) |
| 554 | assert PatternContext.current() == ctx2 |
| 555 | assert not ctx1.match_dfb(dfb) |
| 556 | assert PatternContext.current() == ctx1 |
| 557 | assert ctx0.match_dfb(dfb) |
| 558 | assert PatternContext.current() == ctx0 |
| 559 | |
| 560 | |
| 561 | def test_two_cbr(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…