()
| 213 | |
| 214 | |
| 215 | def test_and_pattern(): |
| 216 | # float[2, 3, 3] |
| 217 | f32_233 = wildcard().has_shape((2, 3, 3)) & has_dtype("float32") |
| 218 | assert isinstance(f32_233, AndPattern) |
| 219 | assert f32_233.match(rx.Var("x", R.Tensor((2, 3, 3), "float32"))) |
| 220 | assert not f32_233.match(rx.Var("x", R.Tensor((3, 3, 3), "float32"))) |
| 221 | assert not f32_233.match(rx.Var("x", R.Tensor("float32", ndim=3))) |
| 222 | |
| 223 | |
| 224 | def test_not_pattern(): |