


'''simple docstring'''



from manim import *






class 	UpperCamelCase__(       lowerCAmelCase	):




				def 					a__(		self      :			str				)->					int:

										"""simple docstring"""




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

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

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

										self.add(lowerCAmelCase				)

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

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

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

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

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

										UpperCAmelCase					    =     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(lowerCAmelCase				,   run_time=2.5				)				,   Write(lowerCAmelCase				)				,   Write(lowerCAmelCase				)				)

										self.add(lowerCAmelCase				)

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

																if i == 0:
																						cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT				)				,   buff=0.02				,   direction=lowerCAmelCase				)
																						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=lowerCAmelCase				,   buff=0.0				)
																else:
																						cpu_target.target.next_to(cpu_targs[i - 1].target				,   direction=lowerCAmelCase				,   buff=0.0				)
																cpu_targs.append(lowerCAmelCase				)

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

										self.play(*lowerCAmelCase				)
										self.play(*lowerCAmelCase				)

										self.wait()









'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_lowercase      :      Union[str, Any]            =					{
    """configuration_poolformer""": [
        """POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """PoolFormerConfig""",
        """PoolFormerOnnxConfig""",
    ]
}

try:
	if not is_vision_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_lowercase      :      List[Any]            =					["""PoolFormerFeatureExtractor"""]
	_lowercase      :      Any            =					["""PoolFormerImageProcessor"""]

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_lowercase      :      Tuple            =					[
	    """POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """PoolFormerForImageClassification""",
	    """PoolFormerModel""",
	    """PoolFormerPreTrainedModel""",
	]


if TYPE_CHECKING:
	from .configuration_poolformer import (
	    POOLFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
	    PoolFormerConfig,
	    PoolFormerOnnxConfig,
	)

	try:
		if not is_vision_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .feature_extraction_poolformer import PoolFormerFeatureExtractor
		from .image_processing_poolformer import PoolFormerImageProcessor

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_poolformer import (
		    POOLFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
		    PoolFormerForImageClassification,
		    PoolFormerModel,
		    PoolFormerPreTrainedModel,
		)


else:
	import sys

	_lowercase      :      Dict            =					_LazyModule(__name__, globals()["""__file__"""], _import_structure)





