def get_pruning_fn(
    pruning_fn: Union[str, Callable], dim: int = None, l_norm: int = None
) -> Callable:
    """[summary]

    Args:
        pruning_fn (Union[str, Callable]): function from torch.nn.utils.prune module
                or your based on BasePruningMethod. Can be string e.g.
                `"l1_unstructured"`. See pytorch docs for more details.
        dim (int, optional): if you are using structured pruning method you need
                to specify dimension. Defaults to None.
        l_norm (int, optional): if you are using
            ln_structured you need to specify l_norm. Defaults to None.

    Raises:
        ValueError: If ``dim`` or ``l_norm`` is not defined when it's required.

    Returns:
        Callable: pruning_fn
    """
    if isinstance(pruning_fn, str):
        if pruning_fn not in PRUNING_FN.keys():
            raise ValueError(
                f"Pruning function should be in {PRUNING_FN.keys()}, "
                "global pruning is not currently support."
            )
        if "unstructured" not in pruning_fn:
            if dim is None:
                raise ValueError(
                    "If you are using structured pruning you"
                    "need to specify dim in args"
                )
            if pruning_fn == "ln_structured":
                if l_norm is None:
                    raise ValueError(
                        "If you are using ln_unstructured you"
                        "need to specify l_norm in args"
                    )
                pruning_fn = _wrap_pruning_fn(prune.ln_structured, dim=dim, n=l_norm)
            else:
                pruning_fn = _wrap_pruning_fn(PRUNING_FN[pruning_fn], dim=dim)
        else:  # unstructured
            pruning_fn = PRUNING_FN[pruning_fn]
    return pruning_fn
[summary]

    Args:
        pruning_fn (Union[str, Callable]): function from torch.nn.utils.prune module
                or your based on BasePruningMethod. Can be string e.g.
                `"l1_unstructured"`. See pytorch docs for more details.
        dim (int, optional): if you are using structured pruning method you need
                to specify dimension. Defaults to None.
        l_norm (int, optional): if you are using
            ln_structured you need to specify l_norm. Defaults to None.

    Raises:
        ValueError: If ``dim`` or ``l_norm`` is not defined when it's required.

    Returns:
        Callable: pruning_fn
    
catalyst/utils/pruning.py