

from __future__ import annotations

from math import pi, sqrt



def 					lowerCAmelCase__							(	SCREAMING_SNAKE_CASE_:							float	,       SCREAMING_SNAKE_CASE_:							float      )			->      tuple:




				'''simple docstring'''





				if inductance <= 0:
								raise ValueError("Inductance cannot be 0 or negative"      )

				elif capacitance <= 0:
								raise ValueError("Capacitance cannot be 0 or negative"      )

				else:
								return (
								    "Resonant frequency",
								    float(1 / (2 * pi * (sqrt(inductance * capacitance      )))      ),
								)


if __name__ == "__main__":
	import doctest

	doctest.testmod()




from typing import Union

import fire
import torch
from tqdm import tqdm



def 					lowerCAmelCase__							(	SCREAMING_SNAKE_CASE_:							str	,       SCREAMING_SNAKE_CASE_:							str = "cpu"	,       SCREAMING_SNAKE_CASE_:							Union[str, None] = None      )			->      None:




				'''simple docstring'''





				A__        =			torch.load(SCREAMING_SNAKE_CASE_	,       map_location=SCREAMING_SNAKE_CASE_      )
				for k, v in tqdm(state_dict.items()      ):
								if not isinstance(SCREAMING_SNAKE_CASE_	,       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(SCREAMING_SNAKE_CASE_	,       SCREAMING_SNAKE_CASE_      )


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

