def test_pytorch_classifier(self):
        """
        Third test with the PyTorchClassifier.
        :return:
        """
        x_train = np.reshape(self.x_train_mnist, (self.x_train_mnist.shape[0], 1, 28, 28)).astype(np.float32)

        # Build PyTorchClassifier
        victim_ptc = get_image_classifier_pt()

        class Model(nn.Module):
            """
            Create model for pytorch.
            """

            def __init__(self):
                super(Model, self).__init__()

                self.conv = nn.Conv2d(in_channels=1, out_channels=1, kernel_size=7)
                self.pool = nn.MaxPool2d(4, 4)
                self.fullyconnected = nn.Linear(25, 10)

            # pylint: disable=W0221
            # disable pylint because of API requirements for function
            def forward(self, x):
                """
                Forward function to evaluate the model

                :param x: Input to the model
                :return: Prediction of the model
                """
                x = self.conv(x)
                x = torch.nn.functional.relu(x)
                x = self.pool(x)
                x = x.reshape(-1, 25)
                x = self.fullyconnected(x)
                x = torch.nn.functional.softmax(x, dim=1)

                return x

        # Define the network
        model = Model()

        # Define a loss function and optimizer
        loss_fn = nn.CrossEntropyLoss()
        optimizer = optim.Adam(model.parameters(), lr=0.01)

        # Get classifier
        thieved_ptc = PyTorchClassifier(
            model=model, loss=loss_fn, optimizer=optimizer, input_shape=(1, 28, 28), nb_classes=10, clip_values=(0, 1)
        )

        # Create attack
        copycat_cnn = CopycatCNN(
            classifier=victim_ptc,
            batch_size_fit=self.batch_size,
            batch_size_query=self.batch_size,
            nb_epochs=NB_EPOCHS,
            nb_stolen=NB_STOLEN,
        )

        thieved_ptc = copycat_cnn.extract(x=x_train, thieved_classifier=thieved_ptc)
        victim_preds = np.argmax(victim_ptc.predict(x=x_train[:100]), axis=1)
        thieved_preds = np.argmax(thieved_ptc.predict(x=x_train[:100]), axis=1)

        acc = np.sum(victim_preds == thieved_preds) / len(victim_preds)

        self.assertGreater(acc, 0.3)

        with self.assertRaises(ValueError):
            _ = CopycatCNN(
                classifier=victim_ptc,
                batch_size_fit=-1,
                batch_size_query=self.batch_size,
                nb_epochs=NB_EPOCHS,
                nb_stolen=NB_STOLEN,
            )

        with self.assertRaises(ValueError):
            _ = CopycatCNN(
                classifier=victim_ptc,
                batch_size_fit=self.batch_size,
                batch_size_query=-1,
                nb_epochs=NB_EPOCHS,
                nb_stolen=NB_STOLEN,
            )

        with self.assertRaises(ValueError):
            _ = CopycatCNN(
                classifier=victim_ptc,
                batch_size_fit=self.batch_size,
                batch_size_query=self.batch_size,
                nb_epochs=-1,
                nb_stolen=NB_STOLEN,
            )

        with self.assertRaises(ValueError):
            _ = CopycatCNN(
                classifier=victim_ptc,
                batch_size_fit=self.batch_size,
                batch_size_query=self.batch_size,
                nb_epochs=NB_EPOCHS,
                nb_stolen=-1,
            )

        with self.assertRaises(ValueError):
            _ = CopycatCNN(
                classifier=victim_ptc,
                batch_size_fit=self.batch_size,
                batch_size_query=self.batch_size,
                nb_epochs=NB_EPOCHS,
                nb_stolen=NB_STOLEN,
                use_probability="True",
            )

        Third test with the PyTorchClassifier.
        :return:
        
tests/attacks/test_copycat_cnn.py