



'''simple docstring'''



from manim import *





class _UpperCamelCase		(     A		):





				'''simple docstring'''





				def 				__lowerCamelCase     (							self  :  Tuple):







											'''simple docstring'''

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

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

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

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

											__lowercase       	=Text('Model'  ,       font_size=2_4)
											__lowercase       	=Group(_lowerCAmelCase  ,       _lowerCAmelCase).arrange(_lowerCAmelCase  ,       buff=0.5  ,       aligned_edge=_lowerCAmelCase)
											model.move_to([3, -1.0, 0])
											self.add(_lowerCAmelCase)

											__lowercase       	=[]
											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)

																		__lowercase       	=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)

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

											__lowercase       	=Text('Loaded Checkpoint'  ,       font_size=2_4)
											__lowercase       	=Group(_lowerCAmelCase  ,       _lowerCAmelCase).arrange(_lowerCAmelCase  ,       aligned_edge=_lowerCAmelCase  ,       buff=0.4)
											checkpoint.move_to([3, 0.5, 0])

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

											__lowercase       	=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(_lowerCAmelCase  ,       _lowerCAmelCase)

											__lowercase       	=MarkupText(
											    f"""<span fgcolor='{BLUE}'>●</span> Checkpoint"""  ,       font_size=1_8  ,       )

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

											__lowercase       	=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=2_4  ,       )
											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))

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

																		__lowercase       	=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()








'''simple docstring'''



import warnings

from ...utils import logging
from .image_processing_deit import DeiTImageProcessor


lowerCamelCase	 =       logging.get_logger(__name__)





class _UpperCamelCase		(     A		):





				'''simple docstring'''





				def __init__(							self  :  Optional[int]  ,       *_lowerCAmelCase  :  Union[str, Any]  ,       **_lowerCAmelCase  :  Union[str, Any]):







											'''simple docstring'''

											warnings.warn(
											    'The class DeiTFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'
											    ' use DeiTImageProcessor instead.'  ,       _lowerCAmelCase  ,       )
											super().__init__(*_lowerCAmelCase  ,       **_lowerCAmelCase)



