class_docstr: The elastic net attack of Pin-Yu Chen et al. (2018).
  
  | Paper link: https://arxiv.org/abs/1709.04114
docstr: Update constants.
  
  :param y_batch: A batch of targets (0-1 hot).
  :param best_label: A batch of best labels.
  :param c_batch: A batch of constants.
  :param c_lower_bound: A batch of lower bound constants.
  :param c_upper_bound: A batch of upper bound constants.
  :return: A tuple of three batches of updated constants and lower/upper bounds.
docstr_tok: ["Update","constants",".",":","param","y_batch",":","A","batch","of","targets","(","0-1","hot",")",".",":","param","best_label",":","A","batch","of","best","labels",".",":","param","c_batch",":","A","batch","of","constants",".",":","param","c_lower_bound",":","A","batch","of","lower","bound","constants",".",":","param","c_upper_bound",":","A","batch","of","upper","bound","constants",".",":","return",":","A","tuple","of","three","batches","of","updated","constants","and","lower\/upper","bounds","."]
code: def _update_const(
      self,
      y_batch: np.ndarray,
      best_label: np.ndarray,
      c_batch: np.ndarray,
      c_lower_bound: np.ndarray,
      c_upper_bound: np.ndarray,
  ) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
      """
      Update constants.
  
      :param y_batch: A batch of targets (0-1 hot).
      :param best_label: A batch of best labels.
      :param c_batch: A batch of constants.
      :param c_lower_bound: A batch of lower bound constants.
      :param c_upper_bound: A batch of upper bound constants.
      :return: A tuple of three batches of updated constants and lower/upper bounds.
      """
  
      def compare(o_1, o_2):
          if self.targeted:
              return o_1 == o_2
          return o_1 != o_2
  
      for i in range(c_batch.shape[0]):
          if (
              compare(best_label[i], np.argmax(y_batch[i]))
              and best_label[i] != -np.inf
          ):
              # Successful attack
              c_upper_bound[i] = min(c_upper_bound[i], c_batch[i])
              if c_upper_bound[i] < 1e9:
                  c_batch[i] = (
                      c_lower_bound[i] + c_upper_bound[i]
                  ) / 2.0
  
          else:
              # Failure attack
              c_lower_bound[i] = max(c_lower_bound[i], c_batch[i])
              if c_upper_bound[i] < 1e9:
                  c_batch[i] = (
                      c_lower_bound[i] + c_upper_bound[i]
                  ) / 2.0
              else:
                  c_batch[i] *= 10
  
      return c_batch, c_lower_bound, c_upper_bound
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, TYPE_CHECKING
  import numpy
  import six
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassGradientsMixin
  from art.utils import compute_success, get_labels_np_array, check_and_transform_label_format
label_desc: Use image node_id 7 for calling the ElasticNet obj's underlying member method code with example usage: obj._update_const(y_batch, best_label, c_batch, c_lower_bound, c_upper_bound) and returns: c_batch,  c_lower_bound,  c_upper_bound, unknown, unknown