def get_accuracy_func(config):
    """Get the accuracy function for an Audioset task.

    Note:
        The accuracy will be computed depending **only on the prediction in
        the last timestep**, where the last timestep refers to the **unpadded
        sequence**.

    Args:
        config (argparse.Namespace): The command line arguments.

    Returns:
        (func): An accuracy function handle.
    """
    def get_accuracy(logit_outputs, targets, data, batch_ids):
        """Get the accuracy for an Audioset task.

        Note that here we expect that, in the multi-head scenario, the correct 
        output head has already been selected, and ``logit_outputs`` corresponds 
        to the outputs in the correct head.

        Args:
            (....) See docstring of function
                :func:`sequential.copy.train_utils_copy.get_accuracy`.

        Returns:
            (....) See docstring of function
                :func:`sequential.copy.train_utils_copy.get_accuracy`.
        """
        seq_length = targets.shape[0]
        batch_size = targets.shape[1]

        # Pick the last prediction per sample.
        logit_outputs = logit_outputs[seq_length-1, :, :]
        # Get the predicted classes.
        # Note, we don't need to apply the softmax, since it doesn't change the
        # argmax.
        predicted = logit_outputs.argmax(dim=1)
        # Targets are the same for all timesteps.
        targets = targets[0, :, :]
        targets = targets.argmax(dim=1)

        accuracy = 100. * (predicted == targets).sum().cpu().item() / \
            batch_size

        return accuracy, None # accuracy per ts not yet implemented

    return get_accuracy