def METHOD_NAME(self):
    self._check_x("run_attack")
    self.hub.set_context(stage="attack")
    x, y, y_pred = self.x, self.y, self.y_pred
    with self.profiler.measure("Attack"):
        if self.attack_type == "preloaded":
            log.warning(
                "Specified preloaded attack. Ignoring `attack_modality` parameter"
            )
            if len(x) == 2:
                x, x_adv = x
            else:
                x_adv = x
            if self.targeted:
                y, y_target = y
            else:
                y_target = None
            misclassified = False
        else:
            if self.use_label:
                y_target = y
            elif self.targeted:
                y_target = self.label_targeter.generate(y)
            elif self.skip_benign:
                y_target = None  # most attacks will call self.model.predict(x)
            else:
                y_target = y_pred
            if self.skip_misclassified:
                if self.targeted:
                    misclassified = all(
                        metrics.task.batch.categorical_accuracy(y_target, y_pred)
                    )
                else:
                    misclassified = not any(
                        metrics.task.batch.categorical_accuracy(y, y_pred)
                    )
            else:
                misclassified = False
            if misclassified:
                x_adv = x
            else:
                x_adv = self.attack.generate(
                    x=x, y=y_target, **self.generate_kwargs
                )
    self.hub.set_context(stage="adversarial")
    if misclassified:
        y_pred_adv = y_pred
    else:
        # Ensure that input sample isn't overwritten by model
        x_adv.flags.writeable = False
        y_pred_adv = self.model.predict(x_adv, **self.predict_kwargs)
    self.probe.update(x_adv=x_adv, y_pred_adv=y_pred_adv)
    if self.targeted:
        self.probe.update(y_target=y_target)
    # Update perturbation metrics for SAR/EO separately
    if self.attack_modality in ("sar", "both"):
        x_adv_sar = np.stack(
            (
                x_adv[..., 0] + 1j * x_adv[..., 1],
                x_adv[..., 2] + 1j * x_adv[..., 3],
            ),
            axis=3,
        )
        self.probe.update(x_adv_sar=x_adv_sar)
    if self.attack_modality in ("eo", "both"):
        x_adv_eo = x_adv[..., 4:]
        self.probe.update(x_adv_eo=x_adv_eo)
    self.x_adv, self.y_target, self.y_pred_adv = x_adv, y_target, y_pred_adv