


'''simple docstring'''


import tempfile
import unittest

from make_student import create_student_by_copying_alternating_layers

from transformers import AutoConfig
from transformers.file_utils import cached_property
from transformers.testing_utils import require_torch


lowerCamelCase__					=   'sshleifer/bart-tiny-random'
lowerCamelCase__					=   'patrickvonplaten/t5-tiny-random'






@require_torch
class 		lowerCAmelCase__	(	unittest.TestCase		):




			@cached_property
			def 							lowerCAmelCase__			(						self     :   Any       )      ->Optional[int]:



					'''simple docstring'''







					return AutoConfig.from_pretrained(lowerCamelCase__       )




			def 							lowerCAmelCase__			(						self     :   Dict       )      ->Dict:



					'''simple docstring'''







					_UpperCAmelCase    ,			*_UpperCAmelCase						:				Optional[Any]	    =					create_student_by_copying_alternating_layers(lowerCamelCase__		,     tempfile.mkdtemp()		,     e=1		,     d=1       )
					self.assertEqual(student.config.num_hidden_layers		,     1       )




			def 							lowerCAmelCase__			(						self     :   Any       )      ->Dict:



					'''simple docstring'''







					_UpperCAmelCase    ,			*_UpperCAmelCase						:				Optional[int]	    =					create_student_by_copying_alternating_layers(lowerCamelCase__		,     tempfile.mkdtemp()		,     e=1		,     d=lowerCamelCase__       )




			def 							lowerCAmelCase__			(						self     :   str       )      ->Union[str, Any]:



					'''simple docstring'''







					_UpperCAmelCase    ,			*_UpperCAmelCase						:				List[str]	    =					create_student_by_copying_alternating_layers(lowerCamelCase__		,     tempfile.mkdtemp()		,     e=1		,     d=lowerCamelCase__       )
					self.assertEqual(student.config.encoder_layers		,     1       )
					self.assertEqual(student.config.decoder_layers		,     self.teacher_config.encoder_layers       )




			def 							lowerCAmelCase__			(						self     :   str       )      ->Optional[int]:



					'''simple docstring'''







					_UpperCAmelCase    ,			*_UpperCAmelCase						:				List[Any]	    =					create_student_by_copying_alternating_layers(lowerCamelCase__		,     tempfile.mkdtemp()		,     e=1		,     d=1       )
					self.assertEqual(student.config.encoder_layers		,     1       )
					self.assertEqual(student.config.decoder_layers		,     1       )






			def 							lowerCAmelCase__			(						self     :   Tuple       )      ->Union[str, Any]:



					'''simple docstring'''







					with self.assertRaises(lowerCamelCase__       ):
							create_student_by_copying_alternating_layers(lowerCamelCase__		,     tempfile.mkdtemp()		,     e=lowerCamelCase__		,     d=lowerCamelCase__       )







'''simple docstring'''


def        __lowerCAmelCase       (__lowerCAmelCase = 50      ):
		_UpperCAmelCase						:				Tuple	    =					[[0] * 3 for _ in range(length + 1      )]

		for row_length in range(length + 1      ):
				for tile_length in range(2					,       5      ):
						for tile_start in range(row_length - tile_length + 1      ):
								different_colour_ways_number[row_length][tile_length - 2] += (
								    different_colour_ways_number[row_length - tile_start - tile_length][
								        tile_length - 2
								    ]
								    + 1
								)

		return sum(different_colour_ways_number[length]      )


if __name__ == "__main__":
						print(F'''{solution() = }''')



