def _calculate_logging_step(tasks, logging_freq, batch_size, task_tr_samples):
    """Calculate for each task how many steps to log information and write to tensorboard.

    Args:
         tasks: a list of task names
         logging_freq: int. How many loggings per epoch.
         batch_size:
         task_tr_samples: a dictionary mapping task name to training samples.
    """
    task_logging_steps = dict()
    for task in tasks:
        total_steps = task_tr_samples[task] // batch_size
        logging_steps = total_steps // logging_freq
        task_logging_steps[task] = logging_steps
    return task_logging_steps