

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowercase_									=   logging.get_logger(__name__)

lowercase_									=   {
    'facebook/convnextv2-tiny-1k-224': 'https://huggingface.co/facebook/convnextv2-tiny-1k-224/resolve/main/config.json',
}





class  __lowerCAmelCase     (					SCREAMING_SNAKE_CASE			,			SCREAMING_SNAKE_CASE							):
  _a									=  """convnextv2"""




  def __init__(				self							,   lowerCAmelCase=3							,   lowerCAmelCase=4							,   lowerCAmelCase=4							,   lowerCAmelCase=None							,   lowerCAmelCase=None							,   lowerCAmelCase="gelu"							,   lowerCAmelCase=0.02							,   lowerCAmelCase=1e-12							,   lowerCAmelCase=0.0							,   lowerCAmelCase=224							,   lowerCAmelCase=None							,   lowerCAmelCase=None							,   **lowerCAmelCase							,   )  -> str:
        '''simple docstring'''






        super().__init__(**lowerCAmelCase					)

        _lowercase	       =num_channels
        _lowercase	       =patch_size
        _lowercase	       =num_stages
        _lowercase	       =[96, 192, 384, 768] if hidden_sizes is None else hidden_sizes
        _lowercase	       =[3, 3, 9, 3] if depths is None else depths
        _lowercase	       =hidden_act
        _lowercase	       =initializer_range
        _lowercase	       =layer_norm_eps
        _lowercase	       =drop_path_rate
        _lowercase	       =image_size
        _lowercase	       =['stem'] + [F'''stage{idx}''' for idx in range(1							,   len(self.depths					) + 1					)]
        _lowercase       ,       _lowercase	       =get_aligned_output_features_output_indices(
            out_features=lowerCAmelCase							,   out_indices=lowerCAmelCase							,   stage_names=self.stage_names					)





from .imports import is_tqdm_available


if is_tqdm_available():
  from tqdm.auto import tqdm as _tqdm

from ..state import PartialState
def      a      (			A__	:   bool = True      ,   *A__	:   int      ,   **A__	:   Union[str, Any]     )    ->      List[str]:





      """simple docstring"""



      if not is_tqdm_available():
            raise ImportError('Accelerate\'s `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.'     )
      _lowercase	       =False
      if main_process_only:
            _lowercase	       =PartialState().local_process_index == 0
      return _tqdm(*A__      ,   **A__      ,   disable=A__     )


