def 					SCREAMING_SNAKE_CASE_			(		lowerCAmelCase_: list ,	lowerCAmelCase_: int     ):
      for index, item in enumerate(lowerCAmelCase_     ):
            if item == target:
                  return index
      return -1






def 					SCREAMING_SNAKE_CASE_			(		lowerCAmelCase_: list ,	lowerCAmelCase_: int ,	lowerCAmelCase_: int ,	lowerCAmelCase_: int     ):
      if not (0 <= high < len(lowerCAmelCase_     ) and 0 <= low < len(lowerCAmelCase_     )):
            raise Exception("Invalid upper or lower bound!"     )
      if high < low:
            return -1
      if sequence[low] == target:
            return low
      if sequence[high] == target:
            return high
      return rec_linear_search(lowerCAmelCase_ ,	low + 1 ,	high - 1 ,	lowerCAmelCase_     )


if __name__ == "__main__":
     UpperCAmelCase							=       input("Enter numbers separated by comma:\n").strip()
     UpperCAmelCase							=       [int(item.strip()) for item in user_input.split(",")]

     UpperCAmelCase							=       int(input("Enter a single number to be found in the list:\n").strip())
     UpperCAmelCase							=       linear_search(sequence, target)
     if result != -1:
          print(F"linear_search({sequence}, {target}) = {result}")
     else:
          print(F"{target} was not found in {sequence}")




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 					snake_case__       (				unittest.TestCase							):



   @slow
   @unittest.skip("Model is not available."   )
   def 					UpperCAmelCase__       (				self   :   Dict   )							->     Optional[Any]:




         '''simple docstring'''




         snake_case_     :			str       =       "nvidia/megatron-gpt2-345m/"
         if "MYDIR" in os.environ:
               snake_case_     :			int       =       os.path.join(os.environ["MYDIR"]			,	A__   )
         snake_case_     :			str       =       GPTaLMHeadModel.from_pretrained(A__   )
         model.to(A__   )
         model.half()

         snake_case_     :			Optional[int]       =       torch.tensor(
             [[1_01, 71_10, 10_05, 10_56, 20_23, 1_13_33, 1_74_13, 10_29, 1_02]]			,	device=A__			,	dtype=torch.long			,	)

         with torch.no_grad():
               snake_case_     :			Union[str, Any]       =       model(A__   ).logits

         snake_case_     :			List[str]       =       torch.Size((1, 9, 5_02_57)   )
         self.assertEqual(output.shape			,	A__   )

         snake_case_     :			Dict       =       torch.tensor(
             [
                 4.9414,
                 -0.2920,
                 -1.2148,
                 -4.0273,
                 -0.5161,
                 -5.2109,
                 -1.2412,
                 -1.8301,
                 -1.7734,
                 -4.7148,
                 -0.2317,
                 -1.0811,
                 -2.1777,
                 0.4141,
                 -3.7969,
                 -4.0586,
                 -2.5332,
                 -3.3809,
                 4.3867,
             ]			,	device=A__			,	dtype=torch.half			,	)

         for i in range(19   ):
               snake_case_  ,snake_case_     :			Dict       =       8 * i // 17, 27_92 * i  # along the diagonal
               snake_case_  ,snake_case_     :			Any       =       output[0, r, c], expected_diag[i]
               snake_case_     :			Dict       =       f"row={r} col={c} computed={computed} expected={expected}"
               self.assertAlmostEqual(A__			,	A__			,	delta=1E-4			,	msg=A__   )



