

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  (      UpperCAmelCase__    ,    UpperCAmelCase__							):
  _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							,     )						->				Union[str, Any]:
      '''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			 =get_aligned_output_features_output_indices(
          out_features=lowerCamelCase__							,     out_indices=lowerCamelCase__							,     stage_names=self.stage_names      )





import unittest

from knapsack import knapsack as k





class 				__lowerCAmelCase  (      unittest.TestCase							):




  def 						A__  (       self      )						->				List[str]:
        '''simple docstring'''






        _lowercase			 =0
        _lowercase			 =[0]
        _lowercase			 =[0]
        _lowercase			 =len(lowerCAmelCase      )
        self.assertEqual(k.knapsack(lowerCAmelCase							,     lowerCAmelCase							,     lowerCAmelCase							,     lowerCAmelCase      )							,     0      )

        _lowercase			 =[60]
        _lowercase			 =[10]
        _lowercase			 =len(lowerCAmelCase      )
        self.assertEqual(k.knapsack(lowerCAmelCase							,     lowerCAmelCase							,     lowerCAmelCase							,     lowerCAmelCase      )							,     0      )




  def 						A__  (       self      )						->				List[Any]:
        '''simple docstring'''






        _lowercase			 =3
        _lowercase			 =[1, 2, 3]
        _lowercase			 =[3, 2, 1]
        _lowercase			 =len(lowerCAmelCase      )
        self.assertEqual(k.knapsack(lowerCAmelCase							,     lowerCAmelCase							,     lowerCAmelCase							,     lowerCAmelCase      )							,     5      )




  def 						A__  (       self      )						->				str:
        '''simple docstring'''






        _lowercase			 =50
        _lowercase			 =[60, 100, 120]
        _lowercase			 =[10, 20, 30]
        _lowercase			 =len(lowerCAmelCase      )
        self.assertEqual(k.knapsack(lowerCAmelCase							,     lowerCAmelCase							,     lowerCAmelCase							,     lowerCAmelCase      )							,     220      )


if __name__ == "__main__":
  unittest.main()


