'''simple docstring'''


import json
import os
import unittest

from transformers.models.roc_bert.tokenization_roc_bert import (
    VOCAB_FILES_NAMES,
    RoCBertBasicTokenizer,
    RoCBertTokenizer,
    RoCBertWordpieceTokenizer,
    _is_control,
    _is_punctuation,
    _is_whitespace,
)
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin, filter_non_english






@require_tokenizers
class 					__SCREAMING_SNAKE_CASE						(	lowerCamelCase_						,     unittest.TestCase	):







  '''simple docstring'''






  lowerCamelCase_		:Optional[Any]						   =		RoCBertTokenizer
  lowerCamelCase_		:Dict						   =		None
  lowerCamelCase_		:List[Any]						   =		False
  lowerCamelCase_		:Any						   =		True
  lowerCamelCase_		:Union[str, Any]						   =		filter_non_english


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       super().setUp()

       UpperCAmelCase_							:       Optional[Any]       =				['[UNK]', '[CLS]', '[SEP]', '[PAD]', '[MASK]', '你', '好', '是', '谁', 'a', 'b', 'c', 'd']
       UpperCAmelCase_							:       Tuple       =				{}
       UpperCAmelCase_							:       Union[str, Any]       =				{}
       for i, value in enumerate(snake_case_						):
            UpperCAmelCase_							:       List[Any]       =				i
            UpperCAmelCase_							:       Union[str, Any]       =				i
       UpperCAmelCase_							:       Optional[Any]       =				os.path.join(self.tmpdirname				,		VOCAB_FILES_NAMES['vocab_file']						)
       UpperCAmelCase_							:       Optional[int]       =				os.path.join(self.tmpdirname				,		VOCAB_FILES_NAMES['word_shape_file']						)
       UpperCAmelCase_							:       Tuple       =				os.path.join(self.tmpdirname				,		VOCAB_FILES_NAMES['word_pronunciation_file']						)
       with open(self.vocab_file				,		'w'				,		encoding='utf-8'						) as vocab_writer:
            vocab_writer.write(''.join([x + '\n' for x in vocab_tokens]						)						)
       with open(self.word_shape_file				,		'w'				,		encoding='utf-8'						) as word_shape_writer:
            json.dump(snake_case_				,		snake_case_				,		ensure_ascii=snake_case_						)
       with open(self.word_pronunciation_file				,		'w'				,		encoding='utf-8'						) as word_pronunciation_writer:
            json.dump(snake_case_				,		snake_case_				,		ensure_ascii=snake_case_						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Optional[int]       =				self.tokenizer_class(self.vocab_file				,		self.word_shape_file				,		self.word_pronunciation_file						)

       UpperCAmelCase_							:       Dict       =				tokenizer.tokenize('你好[SEP]你是谁'						)
       self.assertListEqual(snake_case_				,		['你', '好', '[SEP]', '你', '是', '谁']						)
       self.assertListEqual(tokenizer.convert_tokens_to_ids(snake_case_						)				,		[5, 6, 2, 5, 7, 8]						)
       self.assertListEqual(tokenizer.convert_tokens_to_shape_ids(snake_case_						)				,		[5, 6, 2, 5, 7, 8]						)
       self.assertListEqual(tokenizer.convert_tokens_to_pronunciation_ids(snake_case_						)				,		[5, 6, 2, 5, 7, 8]						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Optional[Any]       =				RoCBertBasicTokenizer()

       self.assertListEqual(tokenizer.tokenize('ah\u535A\u63A8zz'						)				,		['ah', '\u535A', '\u63A8', 'zz']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       List[str]       =				RoCBertBasicTokenizer(do_lower_case=snake_case_						)

       self.assertListEqual(
           tokenizer.tokenize(' \tHeLLo!how  \n Are yoU?  '						)				,		['hello', '!', 'how', 'are', 'you', '?']						)
       self.assertListEqual(tokenizer.tokenize('H\u00E9llo'						)				,		['hello']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Union[str, Any]       =				RoCBertBasicTokenizer(do_lower_case=snake_case_				,		strip_accents=snake_case_						)

       self.assertListEqual(
           tokenizer.tokenize(' \tHäLLo!how  \n Are yoU?  '						)				,		['hällo', '!', 'how', 'are', 'you', '?']						)
       self.assertListEqual(tokenizer.tokenize('H\u00E9llo'						)				,		['h\u00E9llo']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Optional[int]       =				RoCBertBasicTokenizer(do_lower_case=snake_case_				,		strip_accents=snake_case_						)

       self.assertListEqual(
           tokenizer.tokenize(' \tHäLLo!how  \n Are yoU?  '						)				,		['hallo', '!', 'how', 'are', 'you', '?']						)
       self.assertListEqual(tokenizer.tokenize('H\u00E9llo'						)				,		['hello']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       str       =				RoCBertBasicTokenizer(do_lower_case=snake_case_						)

       self.assertListEqual(
           tokenizer.tokenize(' \tHäLLo!how  \n Are yoU?  '						)				,		['hallo', '!', 'how', 'are', 'you', '?']						)
       self.assertListEqual(tokenizer.tokenize('H\u00E9llo'						)				,		['hello']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       int       =				RoCBertBasicTokenizer(do_lower_case=snake_case_						)

       self.assertListEqual(
           tokenizer.tokenize(' \tHeLLo!how  \n Are yoU?  '						)				,		['HeLLo', '!', 'how', 'Are', 'yoU', '?']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Optional[Any]       =				RoCBertBasicTokenizer(do_lower_case=snake_case_				,		strip_accents=snake_case_						)

       self.assertListEqual(
           tokenizer.tokenize(' \tHäLLo!how  \n Are yoU?  '						)				,		['HäLLo', '!', 'how', 'Are', 'yoU', '?']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Any       =				RoCBertBasicTokenizer(do_lower_case=snake_case_				,		strip_accents=snake_case_						)

       self.assertListEqual(
           tokenizer.tokenize(' \tHäLLo!how  \n Are yoU?  '						)				,		['HaLLo', '!', 'how', 'Are', 'yoU', '?']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       List[Any]       =				RoCBertBasicTokenizer(do_lower_case=snake_case_				,		never_split=['[UNK]']						)

       self.assertListEqual(
           tokenizer.tokenize(' \tHeLLo!how  \n Are yoU? [UNK]'						)				,		['HeLLo', '!', 'how', 'Are', 'yoU', '?', '[UNK]']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Dict       =				['[UNK]', '[CLS]', '[SEP]', 'want', '##want', '##ed', 'wa', 'un', 'runn', '##ing']

       UpperCAmelCase_							:       Tuple       =				{}
       for i, token in enumerate(snake_case_						):
            UpperCAmelCase_							:       str       =				i
       UpperCAmelCase_							:       Tuple       =				RoCBertWordpieceTokenizer(vocab=snake_case_				,		unk_token='[UNK]'						)

       self.assertListEqual(tokenizer.tokenize(''						)				,		[]						)

       self.assertListEqual(tokenizer.tokenize('unwanted running'						)				,		['un', '##want', '##ed', 'runn', '##ing']						)

       self.assertListEqual(tokenizer.tokenize('unwantedX running'						)				,		['[UNK]', 'runn', '##ing']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       self.assertTrue(_is_whitespace(' '						)						)
       self.assertTrue(_is_whitespace('\t'						)						)
       self.assertTrue(_is_whitespace('\r'						)						)
       self.assertTrue(_is_whitespace('\n'						)						)
       self.assertTrue(_is_whitespace('\u00A0'						)						)

       self.assertFalse(_is_whitespace('A'						)						)
       self.assertFalse(_is_whitespace('-'						)						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       self.assertTrue(_is_control('\u0005'						)						)

       self.assertFalse(_is_control('A'						)						)
       self.assertFalse(_is_control(' '						)						)
       self.assertFalse(_is_control('\t'						)						)
       self.assertFalse(_is_control('\r'						)						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       self.assertTrue(_is_punctuation('-'						)						)
       self.assertTrue(_is_punctuation('$'						)						)
       self.assertTrue(_is_punctuation('`'						)						)
       self.assertTrue(_is_punctuation('.'						)						)

       self.assertFalse(_is_punctuation('A'						)						)
       self.assertFalse(_is_punctuation(' '						)						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       int       =				self.get_tokenizer()

       # Example taken from the issue https://github.com/huggingface/tokenizers/issues/340
       self.assertListEqual([tokenizer.tokenize(snake_case_						) for t in ['Test', '\xad', 'test']]				,		[['[UNK]'], [], ['[UNK]']]						)

       if self.test_rust_tokenizer:
            UpperCAmelCase_							:       Union[str, Any]       =				self.get_rust_tokenizer()
            self.assertListEqual(
                [rust_tokenizer.tokenize(snake_case_						) for t in ['Test', '\xad', 'test']]				,		[['[UNK]'], [], ['[UNK]']]						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
            with self.subTest(F'''{tokenizer.__class__.__name__} ({pretrained_name})'''						):
                 UpperCAmelCase_							:       Union[str, Any]       =				self.rust_tokenizer_class.from_pretrained(snake_case_				,		**snake_case_						)

                 UpperCAmelCase_							:       Tuple       =				F'''A, naïve {tokenizer_r.mask_token} AllenNLP sentence.'''
                 UpperCAmelCase_							:       Any       =				tokenizer_r.encode_plus(
                     snake_case_				,		return_attention_mask=snake_case_				,		return_token_type_ids=snake_case_				,		return_offsets_mapping=snake_case_				,		add_special_tokens=snake_case_				,		)

                 UpperCAmelCase_							:       List[str]       =				tokenizer_r.do_lower_case if hasattr(snake_case_				,		'do_lower_case'						) else False
                 UpperCAmelCase_							:       int       =				(
                     [
                         ((0, 0), tokenizer_r.cls_token),
                         ((0, 1), 'A'),
                         ((1, 2), ','),
                         ((3, 5), 'na'),
                         ((5, 6), '##ï'),
                         ((6, 8), '##ve'),
                         ((9, 1_5), tokenizer_r.mask_token),
                         ((1_6, 2_1), 'Allen'),
                         ((2_1, 2_3), '##NL'),
                         ((2_3, 2_4), '##P'),
                         ((2_5, 3_3), 'sentence'),
                         ((3_3, 3_4), '.'),
                         ((0, 0), tokenizer_r.sep_token),
                     ]
                     if not do_lower_case
                     else [
                         ((0, 0), tokenizer_r.cls_token),
                         ((0, 1), 'a'),
                         ((1, 2), ','),
                         ((3, 8), 'naive'),
                         ((9, 1_5), tokenizer_r.mask_token),
                         ((1_6, 2_1), 'allen'),
                         ((2_1, 2_3), '##nl'),
                         ((2_3, 2_4), '##p'),
                         ((2_5, 3_3), 'sentence'),
                         ((3_3, 3_4), '.'),
                         ((0, 0), tokenizer_r.sep_token),
                     ]
                 )

                 self.assertEqual(
                     [e[1] for e in expected_results]				,		tokenizer_r.convert_ids_to_tokens(tokens['input_ids']						)						)
                 self.assertEqual([e[0] for e in expected_results]				,		tokens['offset_mapping']						)


  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       List[Any]       =				['的', '人', '有']
       UpperCAmelCase_							:       Any       =				''.join(snake_case_						)
       for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
            with self.subTest(F'''{tokenizer.__class__.__name__} ({pretrained_name})'''						):
                 UpperCAmelCase_							:       List[Any]       =				True
                 UpperCAmelCase_							:       Optional[int]       =				self.tokenizer_class.from_pretrained(snake_case_				,		**snake_case_						)
                 UpperCAmelCase_							:       Tuple       =				self.rust_tokenizer_class.from_pretrained(snake_case_				,		**snake_case_						)

                 UpperCAmelCase_							:       Dict       =				tokenizer_p.encode(snake_case_				,		add_special_tokens=snake_case_						)
                 UpperCAmelCase_							:       Tuple       =				tokenizer_r.encode(snake_case_				,		add_special_tokens=snake_case_						)

                 UpperCAmelCase_							:       Tuple       =				tokenizer_r.convert_ids_to_tokens(snake_case_						)
                 UpperCAmelCase_							:       str       =				tokenizer_p.convert_ids_to_tokens(snake_case_						)

                 # it is expected that each Chinese character is not preceded by "##"
                 self.assertListEqual(snake_case_				,		snake_case_						)
                 self.assertListEqual(snake_case_				,		snake_case_						)

                 UpperCAmelCase_							:       List[Any]       =				False
                 UpperCAmelCase_							:       List[Any]       =				self.rust_tokenizer_class.from_pretrained(snake_case_				,		**snake_case_						)
                 UpperCAmelCase_							:       int       =				self.tokenizer_class.from_pretrained(snake_case_				,		**snake_case_						)

                 UpperCAmelCase_							:       str       =				tokenizer_r.encode(snake_case_				,		add_special_tokens=snake_case_						)
                 UpperCAmelCase_							:       List[str]       =				tokenizer_p.encode(snake_case_				,		add_special_tokens=snake_case_						)

                 UpperCAmelCase_							:       List[Any]       =				tokenizer_r.convert_ids_to_tokens(snake_case_						)
                 UpperCAmelCase_							:       Optional[Any]       =				tokenizer_p.convert_ids_to_tokens(snake_case_						)

                 # it is expected that only the first Chinese character is not preceded by "##".
                 UpperCAmelCase_							:       Dict       =				[
                     F'''##{token}''' if idx != 0 else token for idx, token in enumerate(snake_case_						)
                 ]
                 self.assertListEqual(snake_case_				,		snake_case_						)
                 self.assertListEqual(snake_case_				,		snake_case_						)


  @slow
  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       int       =				self.tokenizer_class(self.vocab_file				,		self.word_shape_file				,		self.word_pronunciation_file						)

       UpperCAmelCase_							:       Optional[Any]       =				tokenizer.encode('你好'				,		add_special_tokens=snake_case_						)
       UpperCAmelCase_							:       Tuple       =				tokenizer.encode('你是谁'				,		add_special_tokens=snake_case_						)

       UpperCAmelCase_							:       List[Any]       =				tokenizer.build_inputs_with_special_tokens(snake_case_						)
       UpperCAmelCase_							:       Optional[Any]       =				tokenizer.build_inputs_with_special_tokens(snake_case_				,		snake_case_						)

       assert encoded_sentence == [1] + text + [2]
       assert encoded_pair == [1] + text + [2] + text_a + [2]






  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       str       =				self.get_tokenizers(do_lower_case=snake_case_						)
       for tokenizer in tokenizers:
            with self.subTest(F'''{tokenizer.__class__.__name__}'''						):
                 UpperCAmelCase_							:       Union[str, Any]       =				'你好，你是谁'
                 UpperCAmelCase_							:       str       =				tokenizer.tokenize(snake_case_						)
                 UpperCAmelCase_							:       Union[str, Any]       =				tokenizer.convert_tokens_to_ids(snake_case_						)
                 UpperCAmelCase_							:       Dict       =				tokenizer.convert_tokens_to_shape_ids(snake_case_						)
                 UpperCAmelCase_							:       Dict       =				tokenizer.convert_tokens_to_pronunciation_ids(snake_case_						)
                 UpperCAmelCase_							:       int       =				tokenizer.prepare_for_model(
                     snake_case_				,		snake_case_				,		snake_case_				,		add_special_tokens=snake_case_						)

                 UpperCAmelCase_							:       Union[str, Any]       =				tokenizer.encode_plus(snake_case_				,		add_special_tokens=snake_case_						)

                 self.assertEqual(snake_case_				,		snake_case_						)







'''simple docstring'''


from manim import *






class 					__SCREAMING_SNAKE_CASE						(	lowerCamelCase_	):







  '''simple docstring'''






  def _UpperCamelCase					(			self						):




       '''simple docstring'''

       UpperCAmelCase_							:       Dict       =				Rectangle(height=0.5				,		width=0.5						)
       UpperCAmelCase_							:       Any       =				Rectangle(height=0.46				,		width=0.46						).set_stroke(width=0						)

       UpperCAmelCase_							:       List[str]       =				Rectangle(height=0.25				,		width=0.25						)

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

       UpperCAmelCase_							:       str       =				[mem.copy() for i in range(4						)]
       UpperCAmelCase_							:       Dict       =				VGroup(*snake_case_						).arrange(snake_case_				,		buff=0						)
       UpperCAmelCase_							:       List[str]       =				Text('GPU'				,		font_size=2_4						)
       UpperCAmelCase_							:       Optional[int]       =				Group(snake_case_				,		snake_case_						).arrange(snake_case_				,		buff=0.5				,		aligned_edge=snake_case_						)
       gpu.move_to([-1, -1, 0]						)
       self.add(snake_case_						)

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

       UpperCAmelCase_							:       str       =				Text('Model'				,		font_size=2_4						)
       UpperCAmelCase_							:       Optional[int]       =				Group(snake_case_				,		snake_case_						).arrange(snake_case_				,		buff=0.5				,		aligned_edge=snake_case_						)
       model.move_to([3, -1.0, 0]						)
       self.add(snake_case_						)

       UpperCAmelCase_							:       str       =				[]
       UpperCAmelCase_							:       Optional[Any]       =				[]

       for i, rect in enumerate(snake_case_						):
            UpperCAmelCase_							:       str       =				fill.copy().set_fill(snake_case_				,		opacity=0.8						)
            target.move_to(snake_case_						)
            model_arr.append(snake_case_						)

            UpperCAmelCase_							:       int       =				Rectangle(height=0.46				,		width=0.46						).set_stroke(width=0.0						).set_fill(snake_case_				,		opacity=0.8						)
            cpu_target.move_to(cpu_left_col_base[i]						)
            model_cpu_arr.append(snake_case_						)

       self.add(*snake_case_				,		*snake_case_						)

       UpperCAmelCase_							:       List[Any]       =				[meta_mem.copy() for i in range(6						)]
       UpperCAmelCase_							:       List[str]       =				[meta_mem.copy() for i in range(6						)]
       UpperCAmelCase_							:       Tuple       =				VGroup(*snake_case_						).arrange(snake_case_				,		buff=0						)
       UpperCAmelCase_							:       Dict       =				VGroup(*snake_case_						).arrange(snake_case_				,		buff=0						)
       UpperCAmelCase_							:       Optional[Any]       =				VGroup(snake_case_				,		snake_case_						).arrange(snake_case_				,		buff=0						)
       UpperCAmelCase_							:       Tuple       =				Text('Disk'				,		font_size=2_4						)
       UpperCAmelCase_							:       Union[str, Any]       =				Group(snake_case_				,		snake_case_						).arrange(snake_case_				,		buff=0.5				,		aligned_edge=snake_case_						)
       disk.move_to([-4, -1.25, 0]						)
       self.add(snake_case_				,		snake_case_						)

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

       UpperCAmelCase_							:       Any       =				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(snake_case_				,		snake_case_						)

       UpperCAmelCase_							:       Dict       =				MarkupText(
           F'''<span fgcolor=\'{BLUE}\'>●</span> Checkpoint'''				,		font_size=1_8				,		)

       blue_text.next_to(snake_case_				,		DOWN * 2.4				,		aligned_edge=key_text.get_left()						)
       self.add(snake_case_						)

       UpperCAmelCase_							:       Optional[Any]       =				MarkupText(
           F'''Now watch as an input is passed through the model\nand how the memory is utilized and handled.'''				,		font_size=2_4				,		)
       step_a.move_to([2, 2, 0]						)

       self.play(Write(snake_case_						)						)

       UpperCAmelCase_							:       Tuple       =				Square(0.3						)
       input.set_fill(snake_case_				,		opacity=1.0						)
       input.set_stroke(width=0.0						)
       input.next_to(model_base[0]				,		snake_case_				,		buff=0.5						)

       self.play(Write(snake_case_						)						)

       input.generate_target()
       input.target.next_to(model_arr[0]				,		direction=snake_case_				,		buff=0.02						)
       self.play(MoveToTarget(snake_case_						)						)

       self.play(FadeOut(snake_case_						)						)

       UpperCAmelCase_							:       Any       =				Arrow(start=snake_case_				,		end=snake_case_				,		color=snake_case_				,		buff=0.5						)
       a.next_to(model_arr[0].get_left()				,		snake_case_				,		buff=0.2						)

       model_cpu_arr[0].generate_target()
       model_cpu_arr[0].target.move_to(gpu_rect[0]						)

       UpperCAmelCase_							:       List[str]       =				MarkupText(
           F'''As the input reaches a layer, the hook triggers\nand weights are moved from the CPU\nto the GPU and back.'''				,		font_size=2_4				,		)
       step_a.move_to([2, 2, 0]						)

       self.play(Write(snake_case_				,		run_time=3						)						)

       UpperCAmelCase_							:       List[Any]       =				{'run_time': 1, 'fade_in': True, 'fade_out': True, 'buff': 0.02}

       self.play(
           Write(snake_case_						)				,		Circumscribe(model_arr[0]				,		color=snake_case_				,		**snake_case_						)				,		Circumscribe(model_cpu_arr[0]				,		color=snake_case_				,		**snake_case_						)				,		Circumscribe(gpu_rect[0]				,		color=snake_case_				,		**snake_case_						)				,		)
       self.play(MoveToTarget(model_cpu_arr[0]						)						)

       UpperCAmelCase_							:       Union[str, Any]       =				a.copy()
       for i in range(6						):
            a_c.next_to(model_arr[i].get_right() + 0.02				,		snake_case_				,		buff=0.2						)

            input.generate_target()
            input.target.move_to(model_arr[i].get_right() + 0.02						)

            UpperCAmelCase_							:       Tuple       =				AnimationGroup(
                FadeOut(snake_case_				,		run_time=0.5						)				,		MoveToTarget(snake_case_				,		run_time=0.5						)				,		FadeIn(snake_case_				,		run_time=0.5						)				,		lag_ratio=0.2						)

            self.play(snake_case_						)

            model_cpu_arr[i].generate_target()
            model_cpu_arr[i].target.move_to(cpu_left_col_base[i]						)

            if i < 5:
                 model_cpu_arr[i + 1].generate_target()
                 model_cpu_arr[i + 1].target.move_to(gpu_rect[0]						)
                 if i >= 1:
                      UpperCAmelCase_							:       Any       =				0.7

                 self.play(
                     Circumscribe(model_arr[i]				,		**snake_case_						)				,		Circumscribe(cpu_left_col_base[i]				,		**snake_case_						)				,		Circumscribe(cpu_left_col_base[i + 1]				,		color=snake_case_				,		**snake_case_						)				,		Circumscribe(gpu_rect[0]				,		color=snake_case_				,		**snake_case_						)				,		Circumscribe(model_arr[i + 1]				,		color=snake_case_				,		**snake_case_						)				,		)
                 if i < 1:
                      self.play(
                          MoveToTarget(model_cpu_arr[i]						)				,		MoveToTarget(model_cpu_arr[i + 1]						)				,		)
                 else:
                      self.play(
                          MoveToTarget(model_cpu_arr[i]				,		run_time=0.7						)				,		MoveToTarget(model_cpu_arr[i + 1]				,		run_time=0.7						)				,		)
            else:
                 model_cpu_arr[i].generate_target()
                 model_cpu_arr[i].target.move_to(cpu_left_col_base[-1]						)
                 input.generate_target()
                 input.target.next_to(model_arr[-1].get_right()				,		RIGHT + 0.02				,		buff=0.2						)

                 self.play(
                     Circumscribe(model_arr[-1]				,		color=snake_case_				,		**snake_case_						)				,		Circumscribe(cpu_left_col_base[-1]				,		color=snake_case_				,		**snake_case_						)				,		Circumscribe(gpu_rect[0]				,		color=snake_case_				,		**snake_case_						)				,		)

                 self.play(MoveToTarget(model_cpu_arr[i]						)						)

            UpperCAmelCase_							:       Any       =				a_c
            UpperCAmelCase_							:       int       =				a_c.copy()

       input.generate_target()
       input.target.next_to(model_base[-1]				,		RIGHT + 0.02				,		buff=0.5						)
       self.play(
           FadeOut(snake_case_						)				,		FadeOut(snake_case_				,		run_time=0.5						)				,		)

       UpperCAmelCase_							:       Optional[Any]       =				MarkupText(F'''Inference on a model too large for GPU memory\nis successfully completed.'''				,		font_size=2_4						)
       step_a.move_to([2, 2, 0]						)

       self.play(Write(snake_case_				,		run_time=3						)				,		MoveToTarget(snake_case_						)						)

       self.wait()






