"""simple docstring"""



def 	_lowerCamelCase(	a   ,    a				):
       if a < 0 or b < 0:
              raise ValueError("the value of both inputs must be positive"				)

       __a       =    str(bin(a				)				)[2:]  # remove the leading "0b"
       __a       =    str(bin(a				)				)[2:]  # remove the leading "0b"

       __a       =    max(len(a				)   ,    len(a				)				)

       return "0b" + "".join(
           str(int(char_a != char_b				)				)
           for char_a, char_b in zip(a_binary.zfill(a				)   ,    b_binary.zfill(a				)				)				)


if __name__ == "__main__":
   import doctest

   doctest.testmod()

"""simple docstring"""



from typing import Union

import fire
import torch
from tqdm import tqdm



def 	_lowerCamelCase(	a   ,    a = "cpu"   ,    a = None				):
       __a       =    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"				)
              __a       =    v.half()
       if save_path is None:  # overwrite src_path
              __a       =    src_path
       torch.save(a   ,    a				)


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