class_docstr: Pure Pytorch implementation of stripe/column ablation.
docstr: Ablates the input column wise
  
  :param x: Input data
  :param column_pos: location to start the retained column. NB, if row_ablation_mode is true then this will
                     be used to act on the rows through transposing the image in ColumnAblatorPyTorch.forward
  :param row_pos: Unused.
  :return: The ablated input with 0s where the ablation occurred
docstr_tok: ["Ablates","the","input","column","wise",":","param","x",":","Input","data",":","param","column_pos",":","location","to","start","the","retained","column",".","NB",",","if","row_ablation_mode","is","true","then","this","will","be","used","to","act","on","the","rows","through","transposing","the","image","in","ColumnAblatorPyTorch.forward",":","param","row_pos",":","Unused",".",":","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: Optional[int] = None,
  ) -> torch.Tensor:
      """
      Ablates the input column wise
  
      :param x: Input data
      :param column_pos: location to start the retained column. NB, if row_ablation_mode is true then this will
                         be used to act on the rows through transposing the image in ColumnAblatorPyTorch.forward
      :param row_pos: Unused.
      :return: The ablated input with 0s where the ablation occurred
      """
      k = self.ablation_size
  
      if isinstance(x, np.ndarray):
          x = torch.from_numpy(x).to(self.device)
  
      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
      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 ColumnAblatorPyTorch obj's underlying member method code with example usage: obj.ablate(x, column_pos, row_pos) and returns: x