    def __init__(
        self,
        num_groups,
        num_channels,
        eps=1e-5,
        affine=True,
        dtype="float16",
        use_swish=False,
        **kwargs,
    ):
        """Group Norm init"""
        super().__init__()
        self.eps = eps
        op_name = "group_norm_swish" if use_swish else "group_norm"
        self.weight = Parameter(shape=[num_channels], dtype=dtype)
        self.bias = Parameter(shape=[num_channels], dtype=dtype)
        self.op = getattr(ops, op_name)(num_groups, num_channels)
Group Norm init
python/aitemplate/frontend/nn/group_norm.py