


import random
from typing import Any




def  a   (lowerCAmelCase__   ):
   for _ in range(len(lowerCAmelCase__   )   ):
      __a					=  random.randint(0		,				len(lowerCAmelCase__   ) - 1   )
      __a					=  random.randint(0		,				len(lowerCAmelCase__   ) - 1   )
      __a	,    __a					=  data[b], data[a]
   return data


if __name__ == "__main__":
  SCREAMING_SNAKE_CASE							    =							[0, 1, 2, 3, 4, 5, 6, 7]
  SCREAMING_SNAKE_CASE							    =							['python', 'says', 'hello', '!']
  print('Fisher-Yates Shuffle:')
  print('List', integers, strings)
  print('FY Shuffle', fisher_yates_shuffle(integers), fisher_yates_shuffle(strings))







'''simple docstring'''






from typing import Union

import fire
import torch
from tqdm import tqdm







def 							UpperCamelCase_     (       A__   :  str				,       A__   :  str = "cpu"				,       A__   :  Union[str, None] = None   ):
  '''simple docstring'''





  lowerCAmelCase_     : Dict     =  torch.load(A__				,       map_location=A__   )
  for k, v in tqdm(state_dict.items()   ):
    if not isinstance(A__				,       torch.Tensor   ):
      raise TypeError("""FP16 conversion only works on paths that are saved state dicts, like pytorch_model.bin"""   )
    lowerCAmelCase_     : List[str]     =  v.half()
  if save_path is None:  # overwrite src_path
    lowerCAmelCase_     : List[str]     =  src_path
  torch.save(A__				,       A__   )


if __name__ == "__main__":
  fire.Fire(convert)



