def METHOD_NAME(name: str, relax_op: Callable, te_func: Callable, dtype: str):
    @tvm.script.ir_module
    class Before:
        @R.function
        def main(x: R.Tensor((2, 3), dtype)):
            nonlocal dtype
            gv = relax_op(x)
            return gv
    @tvm.script.ir_module
    class Expected:
        @R.function
        def main(x: R.Tensor((2, 3), dtype)):
            nonlocal dtype
            gv = R.emit_te(te_func, x, primfunc_name_hint=f"tir_{name}")
            return gv
    mod = LegalizeOps()(Before)
    tvm.ir.assert_structural_equal(mod, Expected)