class_docstr: A task prepares and holds all the components of a training like optimizer, datasets,
  dataloaders, losses, meters etc. Task also contains the variable like training iteration,
  epoch number etc. that are updated during the training.
  
  We prepare every single component according to the parameter settings user wants
  and specified in the yaml config file.
  
  Task also supports 2 additional things:
  1) converts the model BatchNorm layers to the synchronized batchnorm
  2) sets mixed precision (apex and pytorch both supported)
class_docstr_tok: ["A","task","prepares","and","holds","all","the","components","of","a","training","like","optimizer",",","datasets",",","dataloaders",",","losses",",","meters","etc",".","Task","also","contains","the","variable","like","training","iteration",",","epoch","number","etc",".","that","are","updated","during","the","training",".","We","prepare","every","single","component","according","to","the","parameter","settings","user","wants","and","specified","in","the","yaml","config","file",".","Task","also","supports","2","additional","things",":","1",")","converts","the","model","BatchNorm","layers","to","the","synchronized","batchnorm","2",")","sets","mixed","precision","(","apex","and","pytorch","both","supported",")"]
docstr: Called during __init__ to set a flag if manual gradient reduction is enabled.
docstr_tok: ["Called","during","__init__","to","set","a","flag","if","manual","gradient","reduction","is","enabled","."]
code: def set_manual_gradient_reduction(self) -> None:
      """
      Called during __init__ to set a flag if manual gradient reduction is enabled.
      """
      assert self.model is not None
      self._enable_manual_gradient_reduction = (
          manual_gradient_reduction(
              self.model,
              self.config["DISTRIBUTED"]["MANUAL_GRADIENT_REDUCTION"],
          )
      )
      if self._enable_manual_gradient_reduction:
          logging.info("Enabling manual gradient reduction")
  
imports: import gc
  import logging
  import torch
  from classy_vision.generic.distributed_util import is_distributed_training_run
  from classy_vision.generic.util import copy_model_to_gpu
  from classy_vision.hooks import ClassyHook
  from classy_vision.losses import build_loss
  from classy_vision.meters import build_meter
  from classy_vision.optim import build_optimizer, build_optimizer_schedulers
  from classy_vision.tasks import ClassificationTask, register_task
  from classy_vision.tasks.classification_task import AmpType, BroadcastBuffersMode
  from fairscale.nn import FullyShardedDataParallel
  from iopath.common.file_io import g_pathmgr
  from torch.cuda.amp import GradScaler
  from vissl.config import AttrDict
  from vissl.data import build_dataloader, build_dataset, print_sampler_config
  from vissl.models import build_model, convert_sync_bn
  from vissl.optimizers import get_optimizer_param_groups
  from vissl.utils.activation_checkpointing import manual_gradient_reduction
  from vissl.utils.checkpoint import CheckpointLoader
  from vissl.utils.ema_model import ModelEmaV2
  from vissl.utils.misc import is_apex_available, is_fairscale_sharded_available
label_desc: Use image node_id 12 for calling the SelfSupervisionTask obj's underlying member method code with example usage: obj.set_manual_gradient_reduction() without return types