


'''simple docstring'''



from typing import Union

import fire
import torch
from tqdm import tqdm


def    lowerCamelCase__   ( A     :    str   ,     A     :    str = "cpu"   ,     A     :    Union[str, None] = None  ):




						'''simple docstring'''






						UpperCAmelCase         =			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'''  )
												UpperCAmelCase         =			v.half()
						if save_path is None:  # overwrite src_path
												UpperCAmelCase         =			src_path
						torch.save(A   ,     A  )


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









'''simple docstring'''



from ..utils import DummyObject, requires_backends






class  UpperCamelCase__(     metaclass=lowerCAmelCase ):
				__magic_name__       :   List[str]							= ["note_seq"]




				def __init__(	self    :				Any   ,					*lowerCAmelCase    :				List[str]   ,					**lowerCAmelCase    :				int   )->  Optional[int]:

										"""simple docstring"""




										requires_backends(self   ,					['''note_seq''']   )




				@classmethod
				def   a__(	cls    :				Dict   ,					*lowerCAmelCase    :				int   ,					**lowerCAmelCase    :				Optional[int]   )->  Dict:

										"""simple docstring"""




										requires_backends(cls   ,					['''note_seq''']   )





				@classmethod
				def   a__(	cls    :				int   ,					*lowerCAmelCase    :				Tuple   ,					**lowerCAmelCase    :				Optional[Any]   )->  Union[str, Any]:

										"""simple docstring"""




										requires_backends(cls   ,					['''note_seq''']   )





