def ablate(self, x: torch.Tensor | np.ndarray, column_pos: int, row_pos: int | None = 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

        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
        
art/estimators/certification/derandomized_smoothing/ablators/pytorch.py