class_docstr: The elastic net attack of Pin-Yu Chen et al. (2018).
  
  | Paper link: https://arxiv.org/abs/1709.04114
docstr: Compute the loss function values.
  
  :param x: An array with the original input.
  :param x_adv: An array with the adversarial input.
  :return: A tuple of shape `(np.ndarray, float, float, float)` holding the current predictions, l1 distance,
           l2 distance and elastic net loss.
docstr_tok: ["Compute","the","loss","function","values",".",":","param","x",":","An","array","with","the","original","input",".",":","param","x_adv",":","An","array","with","the","adversarial","input",".",":","return",":","A","tuple","of","shape","`","(","np.ndarray",",","float",",","float",",","float",")","`","holding","the","current","predictions",",","l1","distance",",","l2","distance","and","elastic","net","loss","."]
code: def _loss(self, x: np.ndarray, x_adv: np.ndarray) -> tuple:
      """
      Compute the loss function values.
  
      :param x: An array with the original input.
      :param x_adv: An array with the adversarial input.
      :return: A tuple of shape `(np.ndarray, float, float, float)` holding the current predictions, l1 distance,
               l2 distance and elastic net loss.
      """
      l1dist = np.sum(np.abs(x - x_adv).reshape(x.shape[0], -1), axis=1)
      l2dist = np.sum(
          np.square(x - x_adv).reshape(x.shape[0], -1), axis=1
      )
      endist = self.beta * l1dist + l2dist
      predictions = self.estimator.predict(
          np.array(x_adv, dtype=ART_NUMPY_DTYPE),
          batch_size=self.batch_size,
      )
  
      return np.argmax(predictions, axis=1), l1dist, l2dist, endist
  
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 2 for calling the ElasticNet obj's underlying member method code with example usage: obj._loss(x, x_adv) and returns: np,  l1dist,  l2dist,  endist