code: def update_num_microbatches(
      consumed_samples: int, *, consistency_check: bool = True
  ) -> None:
      """Update the number of microbatches upon the number of consumed samples.
  
      .. note::
          This function has no effect unless ``rampup_batch_size`` is set.
  
      Args:
          consumed_samples: The number of consumed samples so far. Basically this is equal to
              :math:`num_iter * global_batch_size`.
          consistency_check: If :obj:`True`, sanity checks the consumed samples, i.e., check if
              ``consumed_samples`` is divisible by :math:`micro_batch_size \times data_parallel_size`.
      """
      _GLOBAL_NUM_MICROBATCHES_CALCULATOR.update(
          consumed_samples, consistency_check
      )
  
imports: import os
  import sys
  import time
  import torch
  from apex.transformer.microbatches import build_num_microbatches_calculator
  from .arguments import parse_args
label_desc: Use image node_id 4 for calling a global function with example usage: update_num_microbatches(consumed_samples) without return types