def mnet_kwargs(config, task_id, mnet):
    """Keyword arguments that should be passed to the main network.

    In particular, if batch normalization is used in the main network, then
    this function makes sure that the main network chooses the correct set
    if batch statistics in case they are checkpointed (i.e., multiple are
    available).

    Args:
        config (argparse.Namespace): Command-line arguments.
        task_id (int): ID of task to be solved by main network.
        mnet: The main network.

    Returns:
        (dict): A set of keyword arguments that should be passed to the main
        network.
    """
    # We need to tell the main network, which batch statistics to use, in case
    # batchnorm is used and we checkpoint the batchnorm stats.
    mnet_kwargs = {}
    if not config.train_from_scratch and mnet.batchnorm_layers is not None:
        if hasattr(config, 'bn_distill_stats') and config.bn_distill_stats:
            raise NotImplementedError()
        elif not config.bn_no_running_stats and \
                not config.bn_no_stats_checkpointing:
            # Specify current task as condition to select correct
            # running stats.
            mnet_kwargs['condition'] = task_id

    return mnet_kwargs