






from manim import *




class  UpperCamelCase_      (			UpperCamelCase__				):



	'''simple docstring'''




	def 							_UpperCamelCase			(       self					)       ->    List[str]:
								snake_case_				=							Rectangle(height=0.5       ,			width=0.5					)
								snake_case_				=							Rectangle(height=0.46       ,			width=0.46					).set_stroke(width=0					)

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

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

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

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

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

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

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

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

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

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

								snake_case_				=							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(lowerCAmelCase__       ,			lowerCAmelCase__					)

								snake_case_				=							MarkupText(
								    F'''<span fgcolor=\'{BLUE}\'>●</span> Checkpoint'''       ,			font_size=18       ,			)

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

								snake_case_				=							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(lowerCAmelCase__					)       ,			Write(lowerCAmelCase__					)					)

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

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

															snake_case_				=							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(lowerCAmelCase__       ,			run_time=1.5					)					)

								self.play(*lowerCAmelCase__					)
								self.play(*lowerCAmelCase__					)
								self.wait()












from diffusers.utils.testing_utils import require_onnxruntime







@require_onnxruntime
class 				__lowerCAmelCase       :
      pass






