def test_mnist_certification(art_warning, fix_get_mnist_data):
    """
    Assert the certification performance on sample MNIST data
    """
    bound = 0.05
    device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")

    ptc = get_image_classifier_pt(from_logits=True, use_maxpool=False)

    box_model = PyTorchIBPClassifier(
        model=ptc.model.to(device),
        clip_values=(0, 1),
        loss=torch.nn.CrossEntropyLoss(),
        input_shape=(1, 28, 28),
        nb_classes=10,
    )

    mnist_data = fix_get_mnist_data[0]
    mnist_labels = fix_get_mnist_data[1]
    box_model.model.set_forward_mode("concrete")
    preds = box_model.predict(mnist_data.astype("float32"))
    acc = np.sum(np.argmax(preds, axis=1) == mnist_labels)
    assert acc == 99

    box_model.model.set_forward_mode("abstract")
    up_bound = np.expand_dims(np.clip(mnist_data + bound, 0, 1), axis=1)
    low_bound = np.expand_dims(np.clip(mnist_data - bound, 0, 1), axis=1)
    interval_x = np.concatenate([low_bound, up_bound], axis=1)

    interval_preds = box_model.predict_intervals(interval_x, is_interval=True)
    cert_results = box_model.certify(preds=interval_preds, labels=mnist_labels)
    assert np.sum(cert_results) == 48

    Assert the certification performance on sample MNIST data
    
tests/estimators/certification/test_interval.py