def ablate(self, x: 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

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