(x)
| 35 | def test_match_sz_0(self): |
| 36 | match_cnt = 0 |
| 37 | def fxn(x): |
| 38 | nonlocal match_cnt |
| 39 | match_cnt += 1 |
| 40 | assert len(x.src) == 0 |
| 41 | return UOp(Ops.CONST, src=(UOp(Ops.CONST),)) |
| 42 | matcher = PatternMatcher([(UPat(Ops.CONST, src=(), name="x"), fxn)]) |
| 43 | c1 = UOp(Ops.CONST, dtypes.float, arg=1.0) |
| 44 | # second rewrite shouldn't match anything |