

from typing import Union

import fire
import torch
from tqdm import tqdm





def a(lowercase__			, lowercase__ = "cpu"			, lowercase__ = None	):





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


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



def a(lowercase__			, lowercase__	):





	'''simple docstring'''
	if not isinstance(lowercase__			, lowercase__	):
		raise ValueError('iterations must be defined as integers'	)
	if not isinstance(lowercase__			, lowercase__	) or not number >= 1:
		raise ValueError(
		    'starting number must be\n                         and integer and be more than 0'	)
	if not iterations >= 1:
		raise ValueError('Iterations must be done more than 0 times to play FizzBuzz'	)

	snake_case_      		= ''
	while number <= iterations:
		if number % 3 == 0:
			out += "Fizz"
		if number % 5 == 0:
			out += "Buzz"
		if 0 not in (number % 3, number % 5):
			out += str(lowercase__	)

		# print(out)
		number += 1
		out += " "
	return out


if __name__ == "__main__":
		import doctest

		doctest.testmod()
