def _calculate_steps(num_examples, batch_size, num_epochs, warmup_proportion=0):
  """Calculates the number of steps.

  Args:
    num_examples: Number of examples in the dataset.
    batch_size: Batch size.
    num_epochs: How many times we should go through the dataset.
    warmup_proportion: Proportion of warmup steps.

  Returns:
    Tuple (number of steps, number of warmup steps).
  """
  steps = int(num_examples / batch_size * num_epochs)
  warmup_steps = int(warmup_proportion * steps)
  return steps, warmup_steps