docstr: Returns a new model with the desired bounds and updates the preprocessing accordingly
docstr_tok: ["Returns","a","new","model","with","the","desired","bounds","and","updates","the","preprocessing","accordingly"]
code: def transform_bounds(
      self,
      bounds: BoundsInput,
      inplace: bool = False,
      wrapper: bool = False,
  ) -> Model:
      """Returns a new model with the desired bounds and updates the preprocessing accordingly"""
      # more efficient than the base class implementation because it avoids the additional wrapper
  
      if wrapper:
          if inplace:
              raise ValueError(
                  "inplace and wrapper cannot both be True"
              )
          return super().transform_bounds(bounds)
  
      if self.bounds == bounds:
          if inplace:
              return self
          else:
              return copy.copy(self)
  
      a, b = self.bounds
      c, d = bounds
      f = (d - c) / (b - a)
  
      mean, std, flip_axis = self._preprocess_args
  
      if mean is None:
          mean = ep.zeros(self._dummy, 1)
      mean = f * (mean - a) + c
  
      if std is None:
          std = ep.ones(self._dummy, 1)
      std = f * std
  
      if inplace:
          model = self
      else:
          model = copy.copy(self)
      model._bounds = Bounds(*bounds)
      model._preprocess_args = (mean, std, flip_axis)
      return model
  
imports: from typing import TypeVar, Callable, Optional, Tuple, Any
  from abc import ABC, abstractmethod
  import copy
  import eagerpy
  from ..types import Bounds, BoundsInput, Preprocessing
  from ..devutils import atleast_kd
label_desc: Use image node_id 5 for calling the ModelWithPreprocessing obj's underlying member method code with example usage: obj.transform_bounds(bounds, inplace, wrapper) and returns: model, super, self, copy