def drop_tokens(x: torch.Tensor, indexes: torch.Tensor) -> torch.Tensor:
        """
        Drops the tokens which correspond to fully masked inputs

        :param x: Input data
        :param indexes: positions to be ablated
        :return: Input with tokens dropped where the input was fully ablated.
        """
        x_no_cl, cls_token = x[:, 1:], x[:, 0:1]
        shape = x_no_cl.shape

        # reshape to temporarily remove batch
        x_no_cl = torch.reshape(x_no_cl, shape=(-1, shape[-1]))
        indexes = torch.reshape(indexes, shape=(-1,))
        indexes = indexes.nonzero(as_tuple=True)[0]
        x_no_cl = torch.index_select(x_no_cl, dim=0, index=indexes)
        x_no_cl = torch.reshape(x_no_cl, shape=(shape[0], -1, shape[-1]))
        return torch.cat((cls_token, x_no_cl), dim=1)

        Drops the tokens which correspond to fully masked inputs

        :param x: Input data
        :param indexes: positions to be ablated
        :return: Input with tokens dropped where the input was fully ablated.
        
art/estimators/certification/derandomized_smoothing/vision_transformers/pytorch.py