class_docstr: Mixin abstract base class defining classifiers providing access to class gradients. A classifier of this type can
  be combined with certain white-box attacks. This mixin abstract base class has to be mixed in with
  class `Classifier`.
class_docstr_tok: ["Mixin","abstract","base","class","defining","classifiers","providing","access","to","class","gradients",".","A","classifier","of","this","type","can","be","combined","with","certain","white-box","attacks",".","This","mixin","abstract","base","class","has","to","be","mixed","in","with","class","`","Classifier","`","."]
docstr: Compute per-class derivatives w.r.t. `x`.
  
  :param x: Samples.
  :type x: `np.ndarray` or `pandas.DataFrame`
  :param label: Index of a specific per-class derivative. If an integer is provided, the gradient of that class
                output is computed for all samples. If multiple values as provided, the first dimension should
                match the batch size of `x`, and each value will be used as target for its corresponding sample in
                `x`. If `None`, then gradients for all classes will be computed for each sample.
  :return: Gradients of input features w.r.t. each class in the form `(batch_size, nb_classes, input_shape)` when
           computing for all classes, otherwise shape becomes `(batch_size, 1, input_shape)` when `label`
           parameter is specified.
code: def class_gradient(
      self,
      x: np.ndarray,
      label: Optional[Union[int, List[int], np.ndarray]] = None,
      **kwargs,
  ) -> np.ndarray:
      """
      Compute per-class derivatives w.r.t. `x`.
  
      :param x: Samples.
      :type x: `np.ndarray` or `pandas.DataFrame`
      :param label: Index of a specific per-class derivative. If an integer is provided, the gradient of that class
                    output is computed for all samples. If multiple values as provided, the first dimension should
                    match the batch size of `x`, and each value will be used as target for its corresponding sample in
                    `x`. If `None`, then gradients for all classes will be computed for each sample.
      :return: Gradients of input features w.r.t. each class in the form `(batch_size, nb_classes, input_shape)` when
               computing for all classes, otherwise shape becomes `(batch_size, 1, input_shape)` when `label`
               parameter is specified.
      """
      raise NotImplementedError
  
imports: from abc import ABC, ABCMeta, abstractmethod
  from typing import List, Optional, Union
  import numpy
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin, LossGradientsMixin, DecisionTreeMixin
label_desc: Use image node_id 1 for calling the ClassGradientsMixin obj's underlying member method code with example usage: obj.class_gradient(x, label) without return types