class_docstr: Randomly drop some regions of feature maps.
  
   Please refer to the method proposed in `DropBlock
   <https://arxiv.org/abs/1810.12890>`_ for details.
  
  Args:
      drop_prob (float): The probability of dropping each block.
      block_size (int): The size of dropped blocks.
      warmup_iters (int): The drop probability will linearly increase
          from `0` to `drop_prob` during the first `warmup_iters` iterations.
          Default: 2000.
docstr: Args:
      x (Tensor): Input feature map on which some areas will be randomly
          dropped.
  
  Returns:
      Tensor: The tensor after DropBlock layer.
docstr_tok: ["Args",":","x","(","Tensor",")",":","Input","feature","map","on","which","some","areas","will","be","randomly","dropped",".","Returns",":","Tensor",":","The","tensor","after","DropBlock","layer","."]
code: def forward(self, x):
      """
      Args:
          x (Tensor): Input feature map on which some areas will be randomly
              dropped.
  
      Returns:
          Tensor: The tensor after DropBlock layer.
      """
      if not self.training:
          return x
      self.iter_cnt += 1
      N, C, H, W = list(x.shape)
      gamma = self._compute_gamma((H, W))
      mask_shape = (
          N,
          C,
          H - self.block_size + 1,
          W - self.block_size + 1,
      )
      mask = torch.bernoulli(
          torch.full(mask_shape, gamma, device=x.device)
      )
  
      mask = F.pad(mask, [self.block_size // 2] * 4, value=0)
      mask = F.max_pool2d(
          input=mask,
          stride=(1, 1),
          kernel_size=(self.block_size, self.block_size),
          padding=self.block_size // 2,
      )
      mask = 1 - mask
      x = x * mask * mask.numel() / (eps + mask.sum())
      return x
  
file_path: mmdetection/mmdet/models/layers/dropblock.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from mmdet.registry import MODELS
label_desc: Use image node_id 2 for calling the DropBlock obj's underlying member method code with example usage: obj.forward(x) and returns: x, x