code: def manual_gradient_reduction(
      model: Module, config_flag: bool
  ) -> bool:
      """
      Return if we should use manual gradient reduction or not.
  
      We should use manual DDP if config says so and model is wrapped by DDP.
      """
      return config_flag and isinstance(model, DistributedDataParallel)
  
file_path: vissl/vissl/utils/activation_checkpointing.py
imports: from typing import Dict, List
  import torch.distributed
  from torch import nn
  from torch.nn import Module
  from torch.nn.parallel import DistributedDataParallel
label_desc: Use image node_id 1 for calling a global function with example usage: manual_gradient_reduction(model, config_flag) and returns: unknown