
"""simple docstring"""




from typing import List, Optional, Tuple, Union

from . import logging
from .import_utils import is_torch_available, is_torch_version


if is_torch_available():
   import torch

_A      :	List[str]       		=	logging.get_logger(__name__)  # pylint: disable=invalid-name

try:
   from torch._dynamo import allow_in_graph as maybe_allow_in_graph
except (ImportError, ModuleNotFoundError):


   def   __magic_name__     (				cls    :	int  )			->    Optional[int]:
          return cls


def   __magic_name__     (				__snake_case    :	Union[Tuple, List]					,			__snake_case    :	Optional[Union[List["torch.Generator"], "torch.Generator"]] = None					,			__snake_case    :	Optional["torch.device"] = None					,			__snake_case    :	Optional["torch.dtype"] = None					,			__snake_case    :	Optional["torch.layout"] = None					,			)			->    Dict:
       lowercase   :    List[Any]			=							device
       lowercase   :    Any			=							shape[0]

       lowercase   :    str			=							layout or torch.strided
       lowercase   :    Optional[int]			=							device or torch.device("cpu"  )

       if generator is not None:
              lowercase   :    Tuple			=							generator.device.type if not isinstance(__snake_case					,			__snake_case  ) else generator[0].device.type
              if gen_device_type != device.type and gen_device_type == "cpu":
                     lowercase   :    Dict			=							"cpu"
                     if device != "mps":
                            logger.info(
                                f"""The passed generator was created on 'cpu' even though a tensor on {device} was expected."""
                                f""" Tensors will be created on 'cpu' and then moved to {device}. Note that one can probably"""
                                f""" slighly speed up this function by passing a generator that was created on the {device} device."""  )
              elif gen_device_type != device.type and gen_device_type == "cuda":
                     raise ValueError(f"""Cannot generate a {device} tensor from a generator of type {gen_device_type}."""  )

       if isinstance(__snake_case					,			__snake_case  ):
              lowercase   :    List[Any]			=							(1,) + shape[1:]
              lowercase   :    List[str]			=							[
                  torch.randn(__snake_case					,			generator=generator[i]					,			device=__snake_case					,			dtype=__snake_case					,			layout=__snake_case  )
                  for i in range(__snake_case  )
              ]
              lowercase   :    Any			=							torch.cat(__snake_case					,			dim=0  ).to(__snake_case  )
       else:
              lowercase   :    Optional[Any]			=							torch.randn(__snake_case					,			generator=__snake_case					,			device=__snake_case					,			dtype=__snake_case					,			layout=__snake_case  ).to(__snake_case  )

       return latents


def   __magic_name__     (				__snake_case    :	Dict  )			->    Tuple:
       if is_torch_version("<"					,			"2.0.0"  ) or not hasattr(__snake_case					,			"_dynamo"  ):
              return False
       return isinstance(__snake_case					,			torch._dynamo.eval_frame.OptimizedModule  )




"""simple docstring"""




import warnings

from ...utils import logging
from .image_processing_convnext import ConvNextImageProcessor


_A      :	List[str]       		=	logging.get_logger(__name__)

class 		a__						(				a_						):
   def __init__(      self     ,   *_a     ,   **_a    ):
          warnings.warn(
              "The class ConvNextFeatureExtractor is deprecated and will be removed in version 5 of Transformers."
              " Please use ConvNextImageProcessor instead."     ,   _a     ,   )
          super().__init__(*_a     ,   **_a    )


