class_docstr: :class:`~opacus.optimizers.optimizer.DPOptimizer` that implements
  per layer clipping strategy and is compatible with distributed data parallel
class_docstr_tok: [":","class",":","`","~opacus.optimizers.optimizer.DPOptimizer","`","that","implements","per","layer","clipping","strategy","and","is","compatible","with","distributed","data","parallel"]
code: def pre_step(
      self, closure: Optional[Callable[[], float]] = None
  ) -> Optional[float]:
      if self._check_skip_next_step():
          self._is_last_step_skipped = True
          return False
  
      if self.step_hook:
          self.step_hook(self)
  
      for p in self.params:
          p.accumulated_iterations = 0
  
      self._is_last_step_skipped = False
      return True
  
imports: from __future__ import annotations
  from functools import partial
  from typing import Callable, List, Optional
  import torch
  from opt_einsum import contract
  from torch import nn
  from torch.optim import Optimizer
  from .ddpoptimizer import DistributedDPOptimizer
  from .optimizer import DPOptimizer, _generate_noise
  from .perlayeroptimizer import DPPerLayerOptimizer
label_desc: Use image node_id 7 for calling the DistributedPerLayerOptimizer obj's underlying member method code with example usage: obj.pre_step(closure) and returns: True, False