
'''simple docstring'''


from typing import Union

import fire
import torch
from tqdm import tqdm




def lowercase_	(   _lowercase			,       _lowercase = "cpu"			,       _lowercase = None				)     ->							List[Any]:
     '''simple docstring'''

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


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




'''simple docstring'''


from __future__ import annotations

from math import pi, sqrt




def lowercase_	(   _lowercase			,       _lowercase				)     ->							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()


