from typing import List
from typing import Any


def _filter_trainable(param_list: List[Any]) -> List[Any]:
    """
    Keep on the trainable parameters of the model and return the list of
    trainable params.
    """
    # Keep only the trainable params
    return list(filter(lambda x: x.requires_grad, param_list))