class_docstr: Randomly zeroes 2D spatial blocks of the input tensor.
  As described in the paper
  `DropBlock: A regularization method for convolutional networks`_ ,
  dropping whole blocks of feature map allows to remove semantic
  information as compared to regular dropout.
  Args:
      drop_prob (float): probability of an element to be dropped.
      block_size (int): size of the block to drop
  Shape:
      - Input: `(N, C, H, W)`
      - Output: `(N, C, H, W)`
  .. _DropBlock: A regularization method for convolutional networks:
     https://arxiv.org/abs/1810.12890
class_docstr_tok: ["Randomly","zeroes","2D","spatial","blocks","of","the","input","tensor",".","As","described","in","the","paper","`","DropBlock",":","A","regularization","method","for","convolutional","networks","`","_",",","dropping","whole","blocks","of","feature","map","allows","to","remove","semantic","information","as","compared","to","regular","dropout",".","Args",":","drop_prob","(","float",")",":","probability","of","an","element","to","be","dropped",".","block_size","(","int",")",":","size","of","the","block","to","drop","Shape",":","-","Input",":","`","(","N",",","C",",","H",",","W",")","`","-","Output",":","`","(","N",",","C",",","H",",","W",")","`","..","_DropBlock",":","A","regularization","method","for","convolutional","networks",":","https",":","\/\/arxiv.org\/abs\/1810.12890"]
code: def _compute_block_mask(self, mask):
      block_mask = F.max_pool2d(
          input=mask[:, None, :, :],
          kernel_size=(self.block_size, self.block_size),
          stride=(1, 1),
          padding=self.block_size // 2,
      )
  
      if self.block_size % 2 == 0:
          block_mask = block_mask[:, :, :-1, :-1]
  
      keeped = block_mask.numel() - block_mask.sum().to(
          torch.float32
      )  # prevent overflow in float16
      block_mask = 1 - block_mask.squeeze(1)
  
      return block_mask, keeped
  
file_path: pytorch-toolbelt/pytorch_toolbelt/modules/dropblock.py
imports: import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 3 for calling the DropBlock2D obj's underlying member method code with example usage: obj._compute_block_mask(mask) and returns: block_mask,  keeped