class_docstr: Pure Pytorch implementation of block ablation.
docstr: Ablates the input block wise
  
  :param x: Input data
  :param column_pos: The start position of the albation
  :param row_pos: The row start position of the albation
  :return: The ablated input with 0s where the ablation occurred
docstr_tok: ["Ablates","the","input","block","wise",":","param","x",":","Input","data",":","param","column_pos",":","The","start","position","of","the","albation",":","param","row_pos",":","The","row","start","position","of","the","albation",":","return",":","The","ablated","input","with","0s","where","the","ablation","occurred"]
code: def ablate(
      self,
      x: Union[torch.Tensor, np.ndarray],
      column_pos: int,
      row_pos: int,
  ) -> torch.Tensor:
      """
      Ablates the input block wise
  
      :param x: Input data
      :param column_pos: The start position of the albation
      :param row_pos: The row start position of the albation
      :return: The ablated input with 0s where the ablation occurred
      """
  
      if isinstance(x, np.ndarray):
          x = torch.from_numpy(x).to(self.device)
  
      k = self.ablation_size
      # Column ablations
      if column_pos + k > x.shape[-1]:
          x[:, :, :, (column_pos + k) % x.shape[-1] : column_pos] = 0.0
      else:
          x[:, :, :, :column_pos] = 0.0
          x[:, :, :, column_pos + k :] = 0.0
  
      # Row ablations
      if row_pos + k > x.shape[-2]:
          x[:, :, (row_pos + k) % x.shape[-2] : row_pos, :] = 0.0
      else:
          x[:, :, :row_pos, :] = 0.0
          x[:, :, row_pos + k :, :] = 0.0
      return x
  
imports: from typing import Optional, Union, Tuple
  import random
  import numpy
  import torch
  from art.estimators.certification.derandomized_smoothing.ablators.ablate import BaseAblator
label_desc: Use image node_id 2 for calling the BlockAblatorPyTorch obj's underlying member method code with example usage: obj.ablate(x, column_pos, row_pos) and returns: x