




"""simple docstring"""




from typing import Union

import fire
import torch
from tqdm import tqdm







def      __UpperCAmelCase     ( __UpperCamelCase	,				__UpperCamelCase = "cpu"	,				__UpperCamelCase = None	):
			__lowercase			:  str								=       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'''	)
						__lowercase			:  Tuple								=       v.half()
			if save_path is None:  # overwrite src_path
						__lowercase			:  List[Any]								=       src_path
			torch.save(__UpperCamelCase	,				__UpperCamelCase	)


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







def 							__lowerCamelCase		(					UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						int		):




      """simple docstring"""





      if b == 0:
            return 1
      if (b % 2) == 0:
            return actual_power(UpperCAmelCase_					,    int(b / 2		)		) * actual_power(UpperCAmelCase_					,    int(b / 2		)		)
      else:
            return a * actual_power(UpperCAmelCase_					,    int(b / 2		)		) * actual_power(UpperCAmelCase_					,    int(b / 2		)		)
def 							__lowerCamelCase		(					UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						int		):




      """simple docstring"""





      if b < 0:
            return 1 / actual_power(UpperCAmelCase_					,    UpperCAmelCase_		)
      return actual_power(UpperCAmelCase_					,    UpperCAmelCase_		)


if __name__ == "__main__":
     print(power(-2, -3))





