'''simple docstring'''
from manim import *






class 			__lowercase		(						__UpperCAmelCase						):







     """simple docstring"""






     def lowerCAmelCase     (		self    ):
         __UpperCamelCase	:	Optional[int]		    =  Rectangle(height=0.5     ,			width=0.5    )
         __UpperCamelCase	:	Union[str, Any]		    =  Rectangle(height=0.2_5     ,			width=0.2_5    )
         __UpperCamelCase	:	Optional[int]		    =  Rectangle(height=0.4_6     ,			width=0.4_6    ).set_stroke(width=0    )

         __UpperCamelCase	:	Optional[Any]		    =  [mem.copy() for i in range(6    )]
         __UpperCamelCase	:	Any		    =  [mem.copy() for i in range(6    )]
         __UpperCamelCase	:	Dict		    =  VGroup(*__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )
         __UpperCamelCase	:	int		    =  VGroup(*__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )
         __UpperCamelCase	:	int		    =  VGroup(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )
         __UpperCamelCase	:	Any		    =  Text('CPU'     ,			font_size=2_4    )
         __UpperCamelCase	:	Optional[int]		    =  Group(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0.5     ,			aligned_edge=__SCREAMING_SNAKE_CASE    )
         cpu.move_to([-2.5, -0.5, 0]    )
         self.add(__SCREAMING_SNAKE_CASE    )

         __UpperCamelCase	:	Dict		    =  [mem.copy() for i in range(4    )]
         __UpperCamelCase	:	Dict		    =  VGroup(*__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )
         __UpperCamelCase	:	Union[str, Any]		    =  Text('GPU'     ,			font_size=2_4    )
         __UpperCamelCase	:	Union[str, Any]		    =  Group(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0.5     ,			aligned_edge=__SCREAMING_SNAKE_CASE    )
         gpu.move_to([-1, -1, 0]    )
         self.add(__SCREAMING_SNAKE_CASE    )

         __UpperCamelCase	:	Any		    =  [mem.copy() for i in range(6    )]
         __UpperCamelCase	:	Tuple		    =  VGroup(*__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )

         __UpperCamelCase	:	Tuple		    =  Text('Model'     ,			font_size=2_4    )
         __UpperCamelCase	:	int		    =  Group(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0.5     ,			aligned_edge=__SCREAMING_SNAKE_CASE    )
         model.move_to([3, -1.0, 0]    )
         self.add(__SCREAMING_SNAKE_CASE    )

         __UpperCamelCase	:	List[str]		    =  []
         __UpperCamelCase	:	Optional[Any]		    =  []
         __UpperCamelCase	:	Any		    =  []

         for i, rect in enumerate(__SCREAMING_SNAKE_CASE    ):
             rect.set_stroke(__SCREAMING_SNAKE_CASE    )

             __UpperCamelCase	:	Any		    =  Rectangle(height=0.4_6 / 4     ,			width=0.4_6 / 3    ).set_stroke(width=0.0    ).set_fill(__SCREAMING_SNAKE_CASE     ,			opacity=0.7    )

             if i == 0:
                 cpu_target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT    )     ,			buff=0.0_2     ,			direction=__SCREAMING_SNAKE_CASE    )
                 cpu_target.set_x(cpu_target.get_x() + 0.1    )
             elif i == 3:
                 cpu_target.next_to(model_cpu_arr[0]     ,			direction=__SCREAMING_SNAKE_CASE     ,			buff=0.0    )
             else:
                 cpu_target.next_to(model_cpu_arr[i - 1]     ,			direction=__SCREAMING_SNAKE_CASE     ,			buff=0.0    )
             self.add(__SCREAMING_SNAKE_CASE    )
             model_cpu_arr.append(__SCREAMING_SNAKE_CASE    )

         self.add(*__SCREAMING_SNAKE_CASE     ,			*__SCREAMING_SNAKE_CASE     ,			*__SCREAMING_SNAKE_CASE    )

         __UpperCamelCase	:	Dict		    =  [mem.copy() for i in range(6    )]
         __UpperCamelCase	:	Optional[int]		    =  VGroup(*__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )

         __UpperCamelCase	:	Tuple		    =  Text('Loaded Checkpoint'     ,			font_size=2_4    )
         __UpperCamelCase	:	int		    =  Group(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0.5     ,			aligned_edge=__SCREAMING_SNAKE_CASE    )
         checkpoint.move_to([3, 0.5, 0]    )

         self.add(__SCREAMING_SNAKE_CASE    )

         __UpperCamelCase	:	Any		    =  []
         __UpperCamelCase	:	Optional[int]		    =  []

         for i, rect in enumerate(__SCREAMING_SNAKE_CASE    ):
             __UpperCamelCase	:	Optional[Any]		    =  fill.copy().set_fill(__SCREAMING_SNAKE_CASE     ,			opacity=0.7    )
             target.move_to(__SCREAMING_SNAKE_CASE    )
             ckpt_arr.append(__SCREAMING_SNAKE_CASE    )

             __UpperCamelCase	:	Dict		    =  target.copy()
             if i < 5:
                 cpu_target.move_to(cpu_left_col_base[i + 1]    )
             else:
                 cpu_target.move_to(cpu_right_col_base[i - 5]    )
             ckpt_cpu_arr.append(__SCREAMING_SNAKE_CASE    )
         self.add(*__SCREAMING_SNAKE_CASE     ,			*__SCREAMING_SNAKE_CASE    )

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

         __UpperCamelCase	:	Optional[Any]		    =  MarkupText(
             f"""<b>Key:</b>\n\n<span fgcolor=\'{YELLOW}\'>●</span> Empty Model"""     ,			font_size=1_8     ,			)

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

         self.add(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE    )

         __UpperCamelCase	:	Optional[int]		    =  MarkupText(
             f"""<span fgcolor=\'{BLUE}\'>●</span> Checkpoint"""     ,			font_size=1_8     ,			)

         blue_text.next_to(__SCREAMING_SNAKE_CASE     ,			DOWN * 2.4     ,			aligned_edge=key_text.get_left()    )
         self.add(__SCREAMING_SNAKE_CASE    )

         __UpperCamelCase	:	str		    =  MarkupText(
             f"""Based on the passed in configuration, weights are stored in\na variety of np.memmaps on disk or to a particular device."""     ,			font_size=2_4     ,			)
         step_a.move_to([2, 2, 0]    )

         __UpperCamelCase	:	Union[str, Any]		    =  [meta_mem.copy() for i in range(6    )]
         __UpperCamelCase	:	List[str]		    =  [meta_mem.copy() for i in range(6    )]
         __UpperCamelCase	:	Optional[Any]		    =  VGroup(*__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )
         __UpperCamelCase	:	List[Any]		    =  VGroup(*__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )
         __UpperCamelCase	:	Optional[int]		    =  VGroup(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0    )
         __UpperCamelCase	:	str		    =  Text('Disk'     ,			font_size=2_4    )
         __UpperCamelCase	:	Any		    =  Group(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE    ).arrange(__SCREAMING_SNAKE_CASE     ,			buff=0.5     ,			aligned_edge=__SCREAMING_SNAKE_CASE    )
         disk.move_to([-4.0, -1.2_5, 0]    )
         self.play(Write(__SCREAMING_SNAKE_CASE     ,			run_time=3    )     ,			Write(__SCREAMING_SNAKE_CASE     ,			run_time=1    )     ,			Create(__SCREAMING_SNAKE_CASE     ,			run_time=1    )    )

         __UpperCamelCase	:	Optional[Any]		    =  []
         for i, rect in enumerate(__SCREAMING_SNAKE_CASE    ):
             __UpperCamelCase	:	Any		    =  rect.copy()
             target.generate_target()
             target.target.move_to(disk_left_col_base[i]    ).scale(0.5    )
             animations.append(MoveToTarget(__SCREAMING_SNAKE_CASE     ,			run_time=1.5    )    )
         self.play(*__SCREAMING_SNAKE_CASE    )

         self.play(FadeOut(__SCREAMING_SNAKE_CASE    )    )

         __UpperCamelCase	:	Tuple		    =  MarkupText(f"""Then, the checkpoint is removed from memory\nthrough garbage collection."""     ,			font_size=2_4    )
         step_a.move_to([2, 2, 0]    )

         self.play(Write(__SCREAMING_SNAKE_CASE     ,			run_time=3    )    )

         self.play(
             FadeOut(__SCREAMING_SNAKE_CASE     ,			__SCREAMING_SNAKE_CASE     ,			*__SCREAMING_SNAKE_CASE     ,			*__SCREAMING_SNAKE_CASE    )     ,			)

         self.wait()




'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a=  {'''configuration_vit_msn''': ['''VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ViTMSNConfig''']}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a=  [
      '''VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''ViTMSNModel''',
      '''ViTMSNForImageClassification''',
      '''ViTMSNPreTrainedModel''',
  ]

if TYPE_CHECKING:
  from .configuration_vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_vit_msn import (
        VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST,
        ViTMSNForImageClassification,
        ViTMSNModel,
        ViTMSNPreTrainedModel,
    )

else:
  import sys

  a=  _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



