def fuse_bn(conv: nn.Module, bn: nn.Module):
    """
    Fuse conv & bn modules.
    """
    kernel = conv.weight
    running_mean = bn.running_mean
    running_var = bn.running_var
    gamma = bn.weight
    beta = bn.bias
    eps = bn.eps
    std = (running_var + eps).sqrt()
    t = (gamma / std).reshape(-1, 1, 1, 1)
    return kernel * t, beta - running_mean * gamma / std
Fuse conv & bn modules.
towhee/models/replknet/utils.py