def hnet_forward(config, hnet, task_id):
    """Create weights for task ``task_id`` using the hypernet ``hnet``.

    This function simply ensures the correct use of the hypernetwork interface,
    based on the type of hypernetwork (old or new).

    Args:
        config (argparse.Namespace): Command-line arguments.
        hnet: The hypernetwork.
        task_id (int): Task ID for which weights should be generated.

    Returns:
        (list): Result of ``forward`` computation.
    """
    if config.use_new_hnet:
        return hnet.forward(cond_id=task_id)
    else:
        return hnet.forward(task_id=task_id)