





'''simple docstring'''

from typing import Union

import fire
import torch
from tqdm import tqdm





def 						UpperCamelCase				(							_lowerCamelCase					:					str						,       _lowerCamelCase					:					str = "cpu"						,       _lowerCamelCase					:					Union[str, None] = None       ):
    A__				=			torch.load(_lowerCamelCase						,       map_location=_lowerCamelCase       )
    for k, v in tqdm(state_dict.items()       ):
        if not isinstance(_lowerCamelCase						,       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(_lowerCamelCase						,       _lowerCamelCase       )


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










'''simple docstring'''

from ..utils import DummyObject, requires_backends






class    UpperCAmelCase	(       metaclass=UpperCamelCase__				):
 __lowercase   		=				["""note_seq"""]
 def __init__(				self      :Optional[Any]						,       *lowercase_      :List[Any]						,       **lowercase_      :List[str]							)->							int:
     requires_backends(self						,       ["note_seq"]							)
 @classmethod
 def      UpperCAmelCase_							(				cls      :str						,       *lowercase_      :Union[str, Any]						,       **lowercase_      :Any							)->							Optional[int]:
     requires_backends(cls						,       ["note_seq"]							)



 @classmethod
 def      UpperCAmelCase_							(				cls      :Dict						,       *lowercase_      :Tuple						,       **lowercase_      :List[Any]							)->							Optional[Any]:
     requires_backends(cls						,       ["note_seq"]							)



