






"""simple docstring"""





def   a    (     __UpperCAmelCase      :    int  )    ->							bool:

						if p < 2:
												raise ValueError("""p should not be less than 2!"""  )
						elif p == 2:
												return True

						__magic_name__:	str							=       4
						__magic_name__:	Tuple							=       (1 << p) - 1
						for _ in range(p - 2  ):
												__magic_name__:	Tuple							=       ((s * s) - 2) % m
						return s == 0


if __name__ == "__main__":
							print(lucas_lehmer_test(7))
							print(lucas_lehmer_test(11))











"""simple docstring"""





from typing import Union

import fire
import torch
from tqdm import tqdm



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


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



