
averager (ModelAverager) -- A model averager instance to
        run post-localSGD algorithm.

Example:
  >>> import torch
  >>> import torch.distributed as dist
  >>> import torch.distributed.algorithms.model_averaging.averagers as averagers
  >>> import torch.nn as nn
  >>> from torch.distributed.optim import PostLocalSGDOptimizer
  >>> from torch.distributed.algorithms.ddp_comm_hooks.post_localSGD_hook import (
  >>>   PostLocalSGDState,
  >>>   post_localSGD_hook,
  >>> )
  >>>
  >>> model = nn.parallel.DistributedDataParallel(
  >>>    module, device_ids=[rank], output_device=rank
  >>> )
  >>>
  >>> # Register a post-localSGD communication hook.
  >>> state = PostLocalSGDState(process_group=None, subgroup=None, start_localSGD_iter=100)
  >>> model.register_comm_hook(state, post_localSGD_hook)
  >>>
  >>> # Create a post-localSGD optimizer that wraps a local optimizer.
