




from manim import *







class     A(		lowerCamelCase_  ):



 '''simple docstring'''


 def 							a__					(							self   :    Optional[Any]    )  ->      List[str]:

       """simple docstring"""






       lowerCamelCase_							=       Rectangle(height=0.5		,				width=0.5    )
       lowerCamelCase_							=       Rectangle(height=0.46		,				width=0.46    ).set_stroke(width=0    )

       lowerCamelCase_							=       [mem.copy() for i in range(6    )]
       lowerCamelCase_							=       [mem.copy() for i in range(6    )]
       lowerCamelCase_							=       VGroup(*snake_case__    ).arrange(snake_case__		,				buff=0    )
       lowerCamelCase_							=       VGroup(*snake_case__    ).arrange(snake_case__		,				buff=0    )
       lowerCamelCase_							=       VGroup(snake_case__		,				snake_case__    ).arrange(snake_case__		,				buff=0    )
       lowerCamelCase_							=       Text('CPU'		,				font_size=24    )
       lowerCamelCase_							=       Group(snake_case__		,				snake_case__    ).arrange(snake_case__		,				buff=0.5		,				aligned_edge=snake_case__    )
       cpu.move_to([-2.5, -0.5, 0]    )
       self.add(snake_case__    )

       lowerCamelCase_							=       [mem.copy() for i in range(1    )]
       lowerCamelCase_							=       VGroup(*snake_case__    ).arrange(snake_case__		,				buff=0    )
       lowerCamelCase_							=       Text('GPU'		,				font_size=24    )
       lowerCamelCase_							=       Group(snake_case__		,				snake_case__    ).arrange(snake_case__		,				buff=0.5		,				aligned_edge=snake_case__    )
       gpu.align_to(snake_case__		,				snake_case__    )
       gpu.set_x(gpu.get_x() - 1    )

       self.add(snake_case__    )

       lowerCamelCase_							=       [mem.copy() for i in range(6    )]
       lowerCamelCase_							=       VGroup(*snake_case__    ).arrange(snake_case__		,				buff=0    )

       lowerCamelCase_							=       Text('Model'		,				font_size=24    )
       lowerCamelCase_							=       Group(snake_case__		,				snake_case__    ).arrange(snake_case__		,				buff=0.5		,				aligned_edge=snake_case__    )
       model.move_to([3, -1.0, 0]    )

       self.play(
           Create(snake_case__		,				run_time=1    )		,				Create(snake_case__		,				run_time=1    )		,				Create(snake_case__		,				run_time=1    )		,				)

       lowerCamelCase_							=       MarkupText(
           f"""First, an empty model skeleton is loaded\ninto <span fgcolor=\'{YELLOW}\'>memory</span> without using much RAM."""		,				font_size=24		,				)

       lowerCamelCase_							=       Square(side_length=2.2    )
       key.move_to([-5, 2, 0]    )

       lowerCamelCase_							=       MarkupText(
           f"""<b>Key:</b>\n\n<span fgcolor=\'{YELLOW}\'>●</span> Empty Model"""		,				font_size=18		,				)

       key_text.move_to([-5, 2.4, 0]    )

       step_a.move_to([2, 2, 0]    )
       self.play(Write(snake_case__		,				run_time=2.5    )		,				Write(snake_case__    )		,				Write(snake_case__    )    )

       self.add(snake_case__    )

       lowerCamelCase_							=       []
       lowerCamelCase_							=       []
       lowerCamelCase_							=       []
       for i, rect in enumerate(snake_case__    ):
             lowerCamelCase_							=       Rectangle(height=0.46		,				width=0.46    ).set_stroke(width=0.0    ).set_fill(snake_case__		,				opacity=0.7    )
             cpu_target.move_to(snake_case__    )
             cpu_target.generate_target()
             lowerCamelCase_							=       0.46 / 4
             lowerCamelCase_							=       0.46 / 3

             if i == 0:
                   cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT    )		,				buff=0.02		,				direction=snake_case__    )
                   cpu_target.target.set_x(cpu_target.target.get_x() + 0.1    )
             elif i == 3:
                   cpu_target.target.next_to(cpu_targs[0].target		,				direction=snake_case__		,				buff=0.0    )
             else:
                   cpu_target.target.next_to(cpu_targs[i - 1].target		,				direction=snake_case__		,				buff=0.0    )
             cpu_targs.append(snake_case__    )

             first_animations.append(rect.animate(run_time=0.5    ).set_stroke(snake_case__    )    )
             second_animations.append(MoveToTarget(snake_case__		,				run_time=1.5    )    )

       self.play(*snake_case__    )
       self.play(*snake_case__    )

       self.wait()









from ....configuration_utils import PretrainedConfig
from ....utils import logging


UpperCamelCase__ :   Any						=							logging.get_logger(__name__)

UpperCamelCase__ :   Any						=							{
    '''Visual-Attention-Network/van-base''': (
        '''https://huggingface.co/Visual-Attention-Network/van-base/blob/main/config.json'''
    ),
}







class 				lowerCAmelCase_       (					lowerCamelCase_							):
				__a     :       List[Any]						=     "van"






				def __init__(			self      ,snake_case__=224      ,snake_case__=3      ,snake_case__=[7, 3, 3, 3]      ,snake_case__=[4, 2, 2, 2]      ,snake_case__=[64, 128, 320, 512]      ,snake_case__=[3, 3, 12, 3]      ,snake_case__=[8, 8, 4, 4]      ,snake_case__="gelu"      ,snake_case__=0.02      ,snake_case__=1E-6      ,snake_case__=1E-2      ,snake_case__=0.0      ,snake_case__=0.0      ,**snake_case__      ,):
							super().__init__(**snake_case__ )
							SCREAMING_SNAKE_CASE_   : Tuple					  =      image_size
							SCREAMING_SNAKE_CASE_   : List[str]					  =      num_channels
							SCREAMING_SNAKE_CASE_   : Dict					  =      patch_sizes
							SCREAMING_SNAKE_CASE_   : str					  =      strides
							SCREAMING_SNAKE_CASE_   : str					  =      hidden_sizes
							SCREAMING_SNAKE_CASE_   : str					  =      depths
							SCREAMING_SNAKE_CASE_   : Optional[Any]					  =      mlp_ratios
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      hidden_act
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      initializer_range
							SCREAMING_SNAKE_CASE_   : Optional[int]					  =      layer_norm_eps
							SCREAMING_SNAKE_CASE_   : int					  =      layer_scale_init_value
							SCREAMING_SNAKE_CASE_   : Union[str, Any]					  =      drop_path_rate
							SCREAMING_SNAKE_CASE_   : List[str]					  =      dropout_rate



