class_docstr: :class:`~opacus.optimizers.optimizer.DPOptimizer` compatible with
  distributed data processing
code: def __init__(
      self,
      optimizer: Optimizer,
      *,
      noise_multiplier: float,
      max_grad_norm: float,
      expected_batch_size: Optional[int],
      loss_reduction: str = "mean",
      generator=None,
      secure_mode: bool = False,
  ):
      super().__init__(
          optimizer,
          noise_multiplier=noise_multiplier,
          max_grad_norm=max_grad_norm,
          expected_batch_size=expected_batch_size,
          loss_reduction=loss_reduction,
          generator=generator,
          secure_mode=secure_mode,
      )
      self.rank = torch.distributed.get_rank()
      self.world_size = torch.distributed.get_world_size()
  
file_path: opacus/opacus/optimizers/ddpoptimizer.py
imports: from __future__ import annotations
  from typing import Callable, Optional
  import torch
  from torch.optim import Optimizer
  from .optimizer import DPOptimizer
label_desc: Use image node_id 1 to create a new DistributedDPOptimizer object from inherited base classes: DPOptimizer with example: obj = DistributedDPOptimizer(optimizer)