def ablate(self, x: np.ndarray, column_pos: int, row_pos: int | None = None) -> np.ndarray:
        """
        Ablates the image only retaining a column starting at "pos" of width "self.ablation_size"

        :param x: input image.
        :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.
        :param row_pos: Unused.
        :return: ablated image keeping only a column.
        """
        if self.row_ablation_mode:
            x = np.transpose(x, (0, 1, 3, 2))

        k = self.ablation_size
        num_of_image_columns = x.shape[-1]

        if column_pos + k > num_of_image_columns:
            start_of_ablation = column_pos + k - num_of_image_columns
            x[:, :, :, start_of_ablation:column_pos] = 0.0
        else:
            x[:, :, :, :column_pos] = 0.0
            x[:, :, :, column_pos + k :] = 0.0

        if self.row_ablation_mode:
            x = np.transpose(x, (0, 1, 3, 2))

        return x

        Ablates the image only retaining a column starting at "pos" of width "self.ablation_size"

        :param x: input image.
        :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.
        :param row_pos: Unused.
        :return: ablated image keeping only a column.
        
art/estimators/certification/derandomized_smoothing/ablators/tensorflow.py