


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 			_lowercase (							lowercase__							,  lowercase__):


       """simple docstring"""




       @register_to_config
       def __init__(   self							:			Optional[int]					,      __lowerCamelCase							:			int = 768					,      ):


             '''simple docstring'''



             super().__init__()

             lowerCamelCase__		:				Tuple    =  nn.Parameter(torch.zeros(1					,      __lowerCamelCase       )       )
             lowerCamelCase__		:				List[Any]    =  nn.Parameter(torch.ones(1					,      __lowerCamelCase       )       )





       def 						lowerCAmelCase     (   self							:			str					,      __lowerCamelCase							:			Optional[Union[str, torch.device]] = None					,      __lowerCamelCase							:			Optional[torch.dtype] = None					,      ):


             '''simple docstring'''



             lowerCamelCase__		:				int    =  nn.Parameter(self.mean.to(__lowerCamelCase       ).to(__lowerCamelCase       )       )
             lowerCamelCase__		:				List[str]    =  nn.Parameter(self.std.to(__lowerCamelCase       ).to(__lowerCamelCase       )       )
             return self





       def 						lowerCAmelCase     (   self							:			List[Any]					,      __lowerCamelCase							:			str       ):


             '''simple docstring'''



             lowerCamelCase__		:				Union[str, Any]    =  (embeds - self.mean) * 1.0 / self.std
             return embeds





       def 						lowerCAmelCase     (   self							:			Optional[Any]					,      __lowerCamelCase							:			List[str]       ):


             '''simple docstring'''



             lowerCamelCase__		:				Optional[Any]    =  (embeds * self.std) + self.mean
             return embeds






import warnings

from ...utils import logging
from .image_processing_beit import BeitImageProcessor


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







class 			_lowercase (							lowercase__):


       """simple docstring"""




       def __init__(   self							:			Optional[int]					,      *__lowerCamelCase							:			List[str]					,      **__lowerCamelCase							:			str       ):


             '''simple docstring'''



             warnings.warn(
                 "The class BeitFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please"
                 " use BeitImageProcessor instead."					,      __lowerCamelCase					,      )
             super().__init__(*__lowerCamelCase					,      **__lowerCamelCase       )


