



"""simple docstring"""


from typing import Union

import fire
import torch
from tqdm import tqdm







def 			lowercase						(   _SCREAMING_SNAKE_CASE :    str       ,  _SCREAMING_SNAKE_CASE :    str = "cpu"       ,  _SCREAMING_SNAKE_CASE :    Union[str, None] = None					):






				'''simple docstring'''



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


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







def    a__    (		snake_case__					:							int						,   snake_case__					:							int     ):
  return 1 if input_a == input_a else 0




def    a__    (		):
  assert xnor_gate(0						,   0     ) == 1
  assert xnor_gate(0						,   1     ) == 0
  assert xnor_gate(1						,   0     ) == 0
  assert xnor_gate(1						,   1     ) == 1


if __name__ == "__main__":
 print(xnor_gate(0, 0))
 print(xnor_gate(0, 1))
 print(xnor_gate(1, 0))
 print(xnor_gate(1, 1))





