class_docstr: :class:`~opacus.optimizers.optimizer.DPOptimizer` compatible with
  distributed data processing
code: def reduce_gradients(self):
      for p in self.params:
          if not p.requires_grad:
              continue
          torch.distributed.all_reduce(
              p.grad, op=torch.distributed.ReduceOp.SUM
          )
          if self.loss_reduction == "mean":
              p.grad /= self.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 3 for calling the DistributedDPOptimizer obj's underlying member method code with example usage: obj.reduce_gradients() without return types