class_docstr: This class tests the ensemble classifier.
class_docstr_tok: ["This","class","tests","the","ensemble","classifier","."]
code: def test_class_gradient(self):
      gradients = self.ensemble.class_gradient(
          self.x_test_mnist, None, raw=False
      )
      self.assertEqual(gradients.shape, (self.n_test, 10, 28, 28, 1))
  
      expected_predictions_1 = np.asarray(
          [
              -1.0557447e-03,
              -1.0079544e-03,
              -7.7426434e-04,
              1.7387432e-03,
              2.1773507e-03,
              5.0880699e-05,
              1.6497371e-03,
              2.6113100e-03,
              6.0904310e-03,
              4.1080985e-04,
              2.5268078e-03,
              -3.6661502e-04,
              -3.0568996e-03,
              -1.1665225e-03,
              3.8904310e-03,
              3.1726385e-04,
              1.3203260e-03,
              -1.1720930e-04,
              -1.4315104e-03,
              -4.7676818e-04,
              9.7251288e-04,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
          ]
      )
      np.testing.assert_array_almost_equal(
          gradients[0, 5, 14, :, 0], expected_predictions_1, decimal=4
      )
  
      gradients_2 = self.ensemble.class_gradient(
          self.x_test_mnist, raw=True
      )
      self.assertEqual(
          gradients_2.shape, (2, self.n_test, 10, 28, 28, 1)
      )
  
      expected_predictions_2 = np.asarray(
          [
              -5.2787235e-04,
              -5.0397718e-04,
              -3.8713217e-04,
              8.6937158e-04,
              1.0886753e-03,
              2.5440349e-05,
              8.2486856e-04,
              1.3056550e-03,
              3.0452155e-03,
              2.0540493e-04,
              1.2634039e-03,
              -1.8330751e-04,
              -1.5284498e-03,
              -5.8326125e-04,
              1.9452155e-03,
              1.5863193e-04,
              6.6016300e-04,
              -5.8604652e-05,
              -7.1575522e-04,
              -2.3838409e-04,
              4.8625644e-04,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
              0.0000000e00,
          ]
      )
      np.testing.assert_array_almost_equal(
          gradients_2[0, 0, 5, 14, :, 0],
          expected_predictions_2,
          decimal=4,
      )
  
file_path: adversarial-robustness-toolbox/tests/estimators/classification/test_ensemble.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  import keras.backend
  import numpy
  from art.estimators.classification.ensemble import EnsembleClassifier
  from tests.utils import TestBase, get_image_classifier_kr
label_desc: Use image node_id 8 for calling the TestEnsembleClassifier obj's underlying member method code with example usage: obj.test_class_gradient() without return types