    def emit(self) -> str:
        template = jinja2.Template(
            """
using {{name}} = {{xdl_op_type}}<
    2, // NDimSpatial
{% if "DeviceConvNdBwdDataNwcKxcNwk_Xdl" in xdl_op_type %}
    {{ADType}}, // InDataType
    {{BDType}}, // WeiDataType
    {{CDType}}, // OutDataType
    {{AccDType}}, // AccDataType
    {{A_elem_op}},
    {{B_elem_op}},
    {{epilogue_functor}},
    {{Conv2DSpecialization}},
{% else %}
    {{InLayout}}, // InLayout
    {{WeiLayout}}, // WeiLayout
    {% if func=="PT" %}
    ck::Tuple<>,
    {% elif func in ["AA", "AAR"] %}
    ck::Tuple<{{OutLayout}}, {{OutLayout}}>, // BiasLayout
    {% else %}
{% if "DeviceGroupedConvBwdDataMultipleD_Xdl_CShuffle_v1" in xdl_op_type %}
    ck::Tuple<ck::tensor_layout::convolution::G_C>, // BiasLayouts
{% else %}
    ck::Tuple<{{OutLayout}}>, // BiasLayout
{% endif %}
    {% endif %}
    {{OutLayout}}, // OutLayout
    {{ADType}}, // InDataType
    {{BDType}}, // WeiDataType
    {{AccDType}}, // AccDataType
    {{CShuffleDType}}, // CShuffleDataType
    {% if func=="PT" %}
    ck::Tuple<>,
    {% elif func in ["AA", "AAR"] %}
    ck::Tuple<{{CDType}}, {{CDType}}>, // BiasLayout
    {% else %}
    ck::Tuple<{{CDType}}>, // BiasDataType
    {% endif %}
    {{CDType}}, // OutDataType

    {{A_elem_op}},
    {{B_elem_op}},
    {{epilogue_functor}},

    {{Conv2DSpecialization}},
{% if "DeviceGroupedConvBwdDataMultipleD_Xdl_CShuffle_v1" in xdl_op_type %}
    true,
    true,
    1,
{% else %}
    {{GemmSpecialization}},
{% endif %}
{% endif %}
    {{tile_config}}
    {{a_block_transfer}}
    {{b_block_transfer}}
{% if "DeviceConvNdBwdDataNwcKxcNwk_Xdl" in xdl_op_type %}
    7, // CThreadTransferSrcDstVectorDim
    1 // GemmCThreadTransferDstScalarPerVector
{% else %}
    {{c_block_transfer}}
{% endif %}
    >;
                """
        )
        return template.render(
            name=self.__str__(),
            xdl_op_type=XdlOpTag[self.xdl_op_type],
            InLayout=library.LayoutTag[self.A.layout],
            WeiLayout=library.LayoutTag[self.B.layout],
            OutLayout=library.LayoutTag[self.C.layout],
            ADType=library.DataTypeTag[self.A.element],
            BDType=library.DataTypeTag[self.B.element],
            CDType=library.DataTypeTag[self.C.element],
            AccDType=library.DataTypeTag[library.DataType.f32],
            CShuffleDType=library.DataTypeTag[self.C.element],
            A_elem_op=library.TensorOperationTag[self.a_elem_op],
            B_elem_op=library.TensorOperationTag[self.b_elem_op],
            epilogue_functor=library.TensorOperationTag[self.epilogue_functor],
            C_data_op=library.MemoryDataOperationTag.get(self.c_data_op, -1),
            Conv2DSpecialization=Conv2DSpecializationTag[self.conv2d_specialization],
            GemmSpecialization=Conv2DSpecializationTag[self.gemm_specialization],
            tile_config=self.tile_desc.emit(),
            a_block_transfer=self.a_block_transfer.emit(),
            b_block_transfer=self.b_block_transfer.emit(),
            c_block_transfer=self.c_block_transfer.emit(),
            func=library.ShortTensorOperationNames[self.epilogue_functor],
        )
using {{name}} = {{xdl_op_type}}<
2, // NDimSpatial
{% if "DeviceConvNdBwdDataNwcKxcNwk_Xdl" in xdl_op_type %}
{{ADType}}, // InDataType
{{BDType}}, // WeiDataType
{{CDType}}, // OutDataType
{{AccDType}}, // AccDataType
{{A_elem_op}},
{{B_elem_op}},
{{epilogue_functor}},
{{Conv2DSpecialization}},
{% else %}
{{InLayout}}, // InLayout
{{WeiLayout}}, // WeiLayout
{% if func=="PT" %}
ck::Tuple<>,
{% elif func in ["AA", "AAR"] %}
ck::Tuple<{{OutLayout}}, {{OutLayout}}>, // BiasLayout
{% else %}
{% if "DeviceGroupedConvBwdDataMultipleD_Xdl_CShuffle_v1" in xdl_op_type %}
ck::Tuple<ck::tensor_layout::convolution::G_C>, // BiasLayouts
{% else %}
ck::Tuple<{{OutLayout}}>, // BiasLayout
{% endif %}
{% endif %}
{{OutLayout}}, // OutLayout
{{ADType}}, // InDataType
{{BDType}}, // WeiDataType
{{AccDType}}, // AccDataType
{{CShuffleDType}}, // CShuffleDataType
{% if func=="PT" %}
ck::Tuple<>,
{% elif func in ["AA", "AAR"] %}
ck::Tuple<{{CDType}}, {{CDType}}>, // BiasLayout
{% else %}
ck::Tuple<{{CDType}}>, // BiasDataType
{% endif %}
{{CDType}}, // OutDataType

{{A_elem_op}},
{{B_elem_op}},
{{epilogue_functor}},

{{Conv2DSpecialization}},
{% if "DeviceGroupedConvBwdDataMultipleD_Xdl_CShuffle_v1" in xdl_op_type %}
true,
true,
1,
{% else %}
{{GemmSpecialization}},
{% endif %}
{% endif %}
{{tile_config}}
{{a_block_transfer}}
{{b_block_transfer}}
{% if "DeviceConvNdBwdDataNwcKxcNwk_Xdl" in xdl_op_type %}
7, // CThreadTransferSrcDstVectorDim
1 // GemmCThreadTransferDstScalarPerVector
{% else %}
{{c_block_transfer}}
{% endif %}
>;
python/aitemplate/utils/mk_ck_lib/conv2d_operation.py