






import os
import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_sentencepiece, require_tokenizers, require_torch, slow, torch_device


if is_torch_available():
							import torch

							from transformers import GPTaLMHeadModel




@require_torch
@require_sentencepiece
@require_tokenizers
class 							__A	(     unittest.TestCase					):





				"""simple docstring"""







				@slow
				@unittest.skip('Model is not available.'       )
				def  __lowercase				(					self       ):




									"""simple docstring"""

									__UpperCamelCase :   Tuple									='nvidia/megatron-gpt2-345m/'
									if "MYDIR" in os.environ:
														__UpperCamelCase :   List[Any]									=os.path.join(os.environ['MYDIR']				,    _A       )
									__UpperCamelCase :   str									=GPTaLMHeadModel.from_pretrained(_A       )
									model.to(_A       )
									model.half()

									__UpperCamelCase :   List[str]									=torch.tensor(
									    [[101, 7110, 1005, 1056, 2023, 11333, 17413, 1029, 102]]				,    device=_A				,    dtype=torch.long				,    )

									with torch.no_grad():
														__UpperCamelCase :   str									=model(_A       ).logits

									__UpperCamelCase :   List[Any]									=torch.Size((1, 9, 50257)       )
									self.assertEqual(output.shape				,    _A       )

									__UpperCamelCase :   str									=torch.tensor(
									    [
									        4.9_414,
									        -0.2_920,
									        -1.2_148,
									        -4.0_273,
									        -0.5_161,
									        -5.2_109,
									        -1.2_412,
									        -1.8_301,
									        -1.7_734,
									        -4.7_148,
									        -0.2_317,
									        -1.0_811,
									        -2.1_777,
									        0.4_141,
									        -3.7_969,
									        -4.0_586,
									        -2.5_332,
									        -3.3_809,
									        4.3_867,
									    ]				,    device=_A				,    dtype=torch.half				,    )

									for i in range(19       ):
														__UpperCamelCase						,							__UpperCamelCase :   Optional[int]									=8 * i // 17, 2792 * i  # along the diagonal
														__UpperCamelCase						,							__UpperCamelCase :   Any									=output[0, r, c], expected_diag[i]
														__UpperCamelCase :   Dict									=f'row={r} col={c} computed={computed} expected={expected}'
														self.assertAlmostEqual(_A				,    _A				,    delta=1E-4				,    msg=_A       )



'''simple docstring'''





def 							snake_case				(		UpperCAmelCase						)->      list:







      """simple docstring"""
      __A													=      1.3
      __A													=      len(UpperCAmelCase						)
      __A													=      False

      while not completed:
            # Update the gap value for a next comb
            __A													=      int(gap / shrink_factor						)
            if gap <= 1:
                  __A													=      True

            __A													=      0
            while index + gap < len(UpperCAmelCase						):
                  if data[index] > data[index + gap]:
                        # Swap values
                        __A						,   __A													=      data[index + gap], data[index]
                        __A													=      False
                  index += 1

      return data


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 a__		: Optional[Any]  							=							input("Enter numbers separated by a comma:\n").strip()
 a__		: Union[str, Any]  							=							[int(item) for item in user_input.split(",")]
 print(comb_sort(unsorted))






