
'''simple docstring'''

from manim import *






class  A  (						SCREAMING_SNAKE_CASE__     ):





	def 				__SCREAMING_SNAKE_CASE	(       self      :							Tuple				):


				"""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(*__magic_name__				).arrange(__magic_name__   ,				buff=0				)
				lowerCAmelCase__										=				VGroup(*__magic_name__				).arrange(__magic_name__   ,				buff=0				)
				lowerCAmelCase__										=				VGroup(__magic_name__   ,				__magic_name__				).arrange(__magic_name__   ,				buff=0				)
				lowerCAmelCase__										=				Text("CPU"   ,				font_size=24				)
				lowerCAmelCase__										=				Group(__magic_name__   ,				__magic_name__				).arrange(__magic_name__   ,				buff=0.5   ,				aligned_edge=__magic_name__				)
				cpu.move_to([-2.5, -0.5, 0]				)
				self.add(__magic_name__				)

				lowerCAmelCase__										=				[mem.copy() for i in range(4				)]
				lowerCAmelCase__										=				VGroup(*__magic_name__				).arrange(__magic_name__   ,				buff=0				)
				lowerCAmelCase__										=				Text("GPU"   ,				font_size=24				)
				lowerCAmelCase__										=				Group(__magic_name__   ,				__magic_name__				).arrange(__magic_name__   ,				buff=0.5   ,				aligned_edge=__magic_name__				)
				gpu.move_to([-1, -1, 0]				)
				self.add(__magic_name__				)

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

				lowerCAmelCase__										=				Text("Model"   ,				font_size=24				)
				lowerCAmelCase__										=				Group(__magic_name__   ,				__magic_name__				).arrange(__magic_name__   ,				buff=0.5   ,				aligned_edge=__magic_name__				)
				model.move_to([3, -1.0, 0]				)
				self.add(__magic_name__				)

				lowerCAmelCase__										=				[]
				for i, rect in enumerate(__magic_name__				):
							rect.set_stroke(__magic_name__				)
							# target = fill.copy().set_fill(YELLOW, opacity=0.7)
							# target.move_to(rect)
							# self.add(target)

							lowerCAmelCase__										=				Rectangle(height=0.46 / 4   ,				width=0.46 / 3				).set_stroke(width=0.0				).set_fill(__magic_name__   ,				opacity=0.7				)

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

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

				lowerCAmelCase__										=				Text("Loaded Checkpoint"   ,				font_size=24				)
				lowerCAmelCase__										=				Group(__magic_name__   ,				__magic_name__				).arrange(__magic_name__   ,				aligned_edge=__magic_name__   ,				buff=0.4				)
				checkpoint.move_to([3, 0.5, 0]				)

				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]				)

				self.add(__magic_name__   ,				__magic_name__				)

				lowerCAmelCase__										=				MarkupText(
				    f"""<span fgcolor='{BLUE}'>●</span> Checkpoint"""   ,				font_size=18   ,				)

				blue_text.next_to(__magic_name__   ,				DOWN * 2.4   ,				aligned_edge=key_text.get_left()				)

				lowerCAmelCase__										=				MarkupText(
				    f"""Next, a <i><span fgcolor=\"{BLUE}\">second</span></i> model is loaded into memory,\nwith the weights of a <span fgcolor=\"{BLUE}\">single shard</span>."""   ,				font_size=24   ,				)
				step_a.move_to([2, 2, 0]				)
				self.play(Write(__magic_name__				)   ,				Write(__magic_name__				)				)

				self.play(Write(__magic_name__   ,				run_time=1				)   ,				Create(__magic_name__   ,				run_time=1				)				)

				lowerCAmelCase__										=				[]
				lowerCAmelCase__										=				[]
				for i, rect in enumerate(__magic_name__				):
							lowerCAmelCase__										=				fill.copy().set_fill(__magic_name__   ,				opacity=0.7				)
							target.move_to(__magic_name__				)
							first_animations.append(GrowFromCenter(__magic_name__   ,				run_time=1				)				)

							lowerCAmelCase__										=				target.copy()
							cpu_target.generate_target()
							if i < 5:
										cpu_target.target.move_to(cpu_left_col_base[i + 1]				)
							else:
										cpu_target.target.move_to(cpu_right_col_base[i - 5]				)
							second_animations.append(MoveToTarget(__magic_name__   ,				run_time=1.5				)				)

				self.play(*__magic_name__				)
				self.play(*__magic_name__				)
				self.wait()







'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


SCREAMING_SNAKE_CASE     =       {"""configuration_deit""": ["""DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DeiTConfig""", """DeiTOnnxConfig"""]}

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE     =       ["""DeiTFeatureExtractor"""]
      SCREAMING_SNAKE_CASE     =       ["""DeiTImageProcessor"""]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE     =       [
          """DEIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """DeiTForImageClassification""",
          """DeiTForImageClassificationWithTeacher""",
          """DeiTForMaskedImageModeling""",
          """DeiTModel""",
          """DeiTPreTrainedModel""",
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE     =       [
          """TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """TFDeiTForImageClassification""",
          """TFDeiTForImageClassificationWithTeacher""",
          """TFDeiTForMaskedImageModeling""",
          """TFDeiTModel""",
          """TFDeiTPreTrainedModel""",
      ]


if TYPE_CHECKING:
      from .configuration_deit import DEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, DeiTConfig, DeiTOnnxConfig

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_deit import DeiTFeatureExtractor
            from .image_processing_deit import DeiTImageProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_deit import (
                DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                DeiTForImageClassification,
                DeiTForImageClassificationWithTeacher,
                DeiTForMaskedImageModeling,
                DeiTModel,
                DeiTPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_deit import (
                TF_DEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFDeiTForImageClassification,
                TFDeiTForImageClassificationWithTeacher,
                TFDeiTForMaskedImageModeling,
                TFDeiTModel,
                TFDeiTPreTrainedModel,
            )


else:
      import sys

      SCREAMING_SNAKE_CASE     =       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



