def METHOD_NAME(layer: torch.nn.Module, module_index: int) -> APEXFusedLayerNorm:
    """Defines a replacement policy from a `torch.nn.LayerNorm` to a `apex.normalization.fused_layer_norm`"""
    if not isinstance(layer, torch.nn.LayerNorm):
        raise TypeError(f'Expected torch.nn.LayerNorm, got {type(layer)}')
    fused_layernorm = APEXFusedLayerNorm(normalized_shape=layer.normalized_shape, eps=layer.eps)
    with torch.no_grad():
        if layer.weight is None:
            fused_layernorm.weight = None
        else:
            fused_layernorm.weight.copy_(layer.weight)
        if layer.bias is None:
            fused_layernorm.bias = None
        else:
            fused_layernorm.bias.copy_(layer.bias)
    return fused_layernorm