"""simple docstring"""




from typing import Union

import fire
import torch
from tqdm import tqdm





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


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





"""simple docstring"""




def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int			) ->   bool:
  return sum(i for i in range(1    ,number // 2 + 1			) if number % i == 0			) == number


if __name__ == "__main__":
     print('Program to check whether a number is a Perfect number or not...')
     _a   :	int 					=     int(input('Enter number: ').strip())
     print(F"""{number} is {"" if perfect(number) else "not "}a Perfect Number.""")




