code: def _linear_search(
      self,
      inputs: Any,
      preproc_input: Any,
      attack_kwargs: Optional[Dict[str, Any]],
      additional_forward_args: Any,
      expanded_additional_args: Any,
      correct_fn_kwargs: Optional[Dict[str, Any]],
      target: TargetType,
      perturbations_per_eval: int,
  ) -> Tuple[Any, Optional[Union[int, float]]]:
      input_list = []
      attack_inp_list = []
      param_list = []
  
      for param in drange(self.arg_min, self.arg_max, self.arg_step):
          for _ in range(self.num_attempts):
              preproc_attacked_inp, attacked_inp = self._apply_attack(
                  inputs, preproc_input, attack_kwargs, param
              )
  
              input_list.append(preproc_attacked_inp)
              param_list.append(param)
              attack_inp_list.append(attacked_inp)
  
              if len(input_list) == perturbations_per_eval:
                  successful_ind = self._evaluate_batch(
                      input_list,
                      expanded_additional_args,
                      correct_fn_kwargs,
                      target,
                  )
                  if successful_ind is not None:
                      return (
                          attack_inp_list[successful_ind],
                          param_list[successful_ind],
                      )
                  input_list = []
                  param_list = []
                  attack_inp_list = []
      if len(input_list) > 0:
          final_add_args = _expand_additional_forward_args(
              additional_forward_args, len(input_list)
          )
          successful_ind = self._evaluate_batch(
              input_list,
              final_add_args,
              correct_fn_kwargs,
              target,
          )
          if successful_ind is not None:
              return (
                  attack_inp_list[successful_ind],
                  param_list[successful_ind],
              )
      return None, None
  
file_path: captum/captum/robust/_core/metrics/min_param_perturbation.py
imports: import math
  from enum import Enum
  from typing import Any, Callable, cast, Dict, Generator, List, Optional, Tuple, Union
  import torch
  from captum._utils.common import _expand_additional_forward_args, _format_additional_forward_args, _reduce_list
  from captum._utils.typing import TargetType
  from captum.log import log_usage
  from captum.robust._core.perturbation import Perturbation
  from torch import Tensor
label_desc: Use image node_id 4 for calling the MinParamPerturbation obj's underlying member method code with example usage: obj._linear_search(inputs, preproc_input, attack_kwargs, additional_forward_args, expanded_additional_args, correct_fn_kwargs, target, perturbations_per_eval) and returns: None,  None, attack_inp_list,  param_list, attack_inp_list,  param_list