'''simple docstring'''


import warnings

from ...utils import logging
from .image_processing_segformer import SegformerImageProcessor


snake_case__					:      Optional[int]				      =  logging.get_logger(__name__)






class 					__SCREAMING_SNAKE_CASE						(	lowerCamelCase_	):







  '''simple docstring'''






  def __init__(			self				,		*snake_case_				,		**snake_case_						):




       '''simple docstring'''

       warnings.warn(
           'The class SegformerFeatureExtractor is deprecated and will be removed in version 5 of Transformers.'
           ' Please use SegformerImageProcessor instead.'				,		snake_case_				,		)
       super().__init__(*snake_case_				,		**snake_case_						)







'''simple docstring'''


from typing import Optional, Union

import torch
from torch import nn

from ...configuration_utils import ConfigMixin, register_to_config
from ...models.modeling_utils import ModelMixin






class 					__SCREAMING_SNAKE_CASE						(	lowerCamelCase_						,     lowerCamelCase_	):







  '''simple docstring'''






  @register_to_config
  def __init__(			self				,		snake_case_ = 7_6_8				,		):




       '''simple docstring'''

       super().__init__()

       UpperCAmelCase_							:       int       =				nn.Parameter(torch.zeros(1				,		snake_case_						)						)
       UpperCAmelCase_							:       str       =				nn.Parameter(torch.ones(1				,		snake_case_						)						)


  def _UpperCamelCase					(			self				,		snake_case_ = None				,		snake_case_ = None				,		):




       '''simple docstring'''

       UpperCAmelCase_							:       int       =				nn.Parameter(self.mean.to(snake_case_						).to(snake_case_						)						)
       UpperCAmelCase_							:       Tuple       =				nn.Parameter(self.std.to(snake_case_						).to(snake_case_						)						)
       return self


  def _UpperCamelCase					(			self				,		snake_case_						):




       '''simple docstring'''

       UpperCAmelCase_							:       Dict       =				(embeds - self.mean) * 1.0 / self.std
       return embeds






  def _UpperCamelCase					(			self				,		snake_case_						):




       '''simple docstring'''

       UpperCAmelCase_							:       List[Any]       =				(embeds * self.std) + self.mean
       return embeds






