



'''simple docstring'''




from manim import *






class 		_UpperCamelCase						(							lowerCamelCase__					):


			'''simple docstring'''

			def UpperCamelCase__      (							self  :				Union[str, Any]		):





					"""simple docstring"""






					__SCREAMING_SNAKE_CASE :	Tuple					 =	Rectangle(height=0.5							,  width=0.5		)
					__SCREAMING_SNAKE_CASE :	Any					 =	Rectangle(height=0.46							,  width=0.46		).set_stroke(width=0		)

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

					__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	[mem.copy() for i in range(1		)]
					__SCREAMING_SNAKE_CASE :	List[str]					 =	VGroup(*lowerCAmelCase__		).arrange(lowerCAmelCase__							,  buff=0		)
					__SCREAMING_SNAKE_CASE :	List[Any]					 =	Text("""GPU"""							,  font_size=2_4		)
					__SCREAMING_SNAKE_CASE :	Union[str, Any]					 =	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__		)

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

					__SCREAMING_SNAKE_CASE :	Union[str, Any]					 =	Text("""Model"""							,  font_size=2_4		)
					__SCREAMING_SNAKE_CASE :	List[Any]					 =	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		)							,  )

					__SCREAMING_SNAKE_CASE :	List[str]					 =	MarkupText(
					    F"First, an empty model skeleton is loaded\ninto <span fgcolor='{YELLOW}'>memory</span> without using much RAM."							,  font_size=2_4							,  )

					__SCREAMING_SNAKE_CASE :	Optional[Any]					 =	Square(side_length=2.2		)
					key.move_to([-5, 2, 0]		)

					__SCREAMING_SNAKE_CASE :	Dict					 =	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]		)

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

					self.add(lowerCAmelCase__		)

					__SCREAMING_SNAKE_CASE :	Optional[int]					 =	[]
					__SCREAMING_SNAKE_CASE :	List[str]					 =	[]
					__SCREAMING_SNAKE_CASE :	str					 =	[]
					for i, rect in enumerate(lowerCAmelCase__		):
							__SCREAMING_SNAKE_CASE :	Any					 =	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()
							__SCREAMING_SNAKE_CASE :	List[str]					 =	0.46 / 4
							__SCREAMING_SNAKE_CASE :	Dict					 =	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 ..utils import DummyObject, requires_backends






class 		_UpperCamelCase						(							metaclass=lowerCamelCase__					):


			'''simple docstring'''

			_A   :	Union[str, Any]    					=	['''torch''', '''transformers''', '''onnx''']

			def __init__(							self  :				Optional[int]							,  *lowerCAmelCase__  :				Optional[Any]							,  **lowerCAmelCase__  :				int		):





					"""simple docstring"""






					requires_backends(self							,  ["""torch""", """transformers""", """onnx"""]		)

			@classmethod
			def UpperCamelCase__      (							cls  :				Tuple							,  *lowerCAmelCase__  :				Union[str, Any]							,  **lowerCAmelCase__  :				Optional[int]		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)



			@classmethod
			def UpperCamelCase__      (							cls  :				str							,  *lowerCAmelCase__  :				int							,  **lowerCAmelCase__  :				Optional[Any]		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)






class 		_UpperCamelCase						(							metaclass=lowerCamelCase__					):


			'''simple docstring'''

			_A   :	Dict    					=	['''torch''', '''transformers''', '''onnx''']

			def __init__(							self  :				str							,  *lowerCAmelCase__  :				str							,  **lowerCAmelCase__  :				List[str]		):





					"""simple docstring"""






					requires_backends(self							,  ["""torch""", """transformers""", """onnx"""]		)

			@classmethod
			def UpperCamelCase__      (							cls  :				Optional[Any]							,  *lowerCAmelCase__  :				Dict							,  **lowerCAmelCase__  :				Dict		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)



			@classmethod
			def UpperCamelCase__      (							cls  :				str							,  *lowerCAmelCase__  :				List[str]							,  **lowerCAmelCase__  :				str		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)






class 		_UpperCamelCase						(							metaclass=lowerCamelCase__					):


			'''simple docstring'''

			_A   :	Tuple    					=	['''torch''', '''transformers''', '''onnx''']

			def __init__(							self  :				str							,  *lowerCAmelCase__  :				List[str]							,  **lowerCAmelCase__  :				Dict		):





					"""simple docstring"""






					requires_backends(self							,  ["""torch""", """transformers""", """onnx"""]		)

			@classmethod
			def UpperCamelCase__      (							cls  :				Any							,  *lowerCAmelCase__  :				Tuple							,  **lowerCAmelCase__  :				Any		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)



			@classmethod
			def UpperCamelCase__      (							cls  :				List[str]							,  *lowerCAmelCase__  :				Union[str, Any]							,  **lowerCAmelCase__  :				Dict		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)






class 		_UpperCamelCase						(							metaclass=lowerCamelCase__					):


			'''simple docstring'''

			_A   :	Optional[int]    					=	['''torch''', '''transformers''', '''onnx''']

			def __init__(							self  :				Optional[int]							,  *lowerCAmelCase__  :				Dict							,  **lowerCAmelCase__  :				List[Any]		):





					"""simple docstring"""






					requires_backends(self							,  ["""torch""", """transformers""", """onnx"""]		)

			@classmethod
			def UpperCamelCase__      (							cls  :				Any							,  *lowerCAmelCase__  :				List[Any]							,  **lowerCAmelCase__  :				List[str]		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)



			@classmethod
			def UpperCamelCase__      (							cls  :				List[str]							,  *lowerCAmelCase__  :				str							,  **lowerCAmelCase__  :				Optional[int]		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)






class 		_UpperCamelCase						(							metaclass=lowerCamelCase__					):


			'''simple docstring'''

			_A   :	Union[str, Any]    					=	['''torch''', '''transformers''', '''onnx''']

			def __init__(							self  :				Optional[int]							,  *lowerCAmelCase__  :				int							,  **lowerCAmelCase__  :				List[str]		):





					"""simple docstring"""






					requires_backends(self							,  ["""torch""", """transformers""", """onnx"""]		)

			@classmethod
			def UpperCamelCase__      (							cls  :				List[str]							,  *lowerCAmelCase__  :				int							,  **lowerCAmelCase__  :				int		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)



			@classmethod
			def UpperCamelCase__      (							cls  :				str							,  *lowerCAmelCase__  :				int							,  **lowerCAmelCase__  :				List[Any]		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)






class 		_UpperCamelCase						(							metaclass=lowerCamelCase__					):


			'''simple docstring'''

			_A   :	Optional[Any]    					=	['''torch''', '''transformers''', '''onnx''']

			def __init__(							self  :				Optional[int]							,  *lowerCAmelCase__  :				Tuple							,  **lowerCAmelCase__  :				List[str]		):





					"""simple docstring"""






					requires_backends(self							,  ["""torch""", """transformers""", """onnx"""]		)

			@classmethod
			def UpperCamelCase__      (							cls  :				Tuple							,  *lowerCAmelCase__  :				Dict							,  **lowerCAmelCase__  :				List[Any]		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)



			@classmethod
			def UpperCamelCase__      (							cls  :				List[str]							,  *lowerCAmelCase__  :				Dict							,  **lowerCAmelCase__  :				Tuple		):





					"""simple docstring"""






					requires_backends(cls							,  ["""torch""", """transformers""", """onnx"""]		)