def METHOD_NAME(output_shapes):
  """Recalculates the output_shapes after dividing it by num_replicas."""
  if len(output_shapes) < 1:
    raise ValueError(
        "Input shape should have at least one dimension. "
        "Perhaps your input dataset is not batched?")
  output_dims = [d.value for d in output_shapes.dims]
  if output_dims[0] is not None and output_dims[0] % num_replicas == 0:
    output_dims[0] = output_dims[0] // num_replicas
  else:
    # Set the batch dimension to unknown. If the global batch size does not
    # divide num_replicas evenly, the minibatches may have different sizes.
    output_dims[0] = None
  return tensor_shape.TensorShape(output_dims)