
"""simple docstring"""






def  __lowerCamelCase					(					lowerCAmelCase__				):
				A__							 =       int(lowercase_				)
				if n_element < 1:
								A__							 =       ValueError('a should be a positive number'				)
								raise my_error

				A__							 =       [1]
				A__							 =       (0, 0, 0)
				A__							 =       1
				while index < n_element:
								while hamming_list[i] * 2 <= hamming_list[-1]:
												i += 1
								while hamming_list[j] * 3 <= hamming_list[-1]:
												j += 1
								while hamming_list[k] * 5 <= hamming_list[-1]:
												k += 1
								hamming_list.append(
								    min(hamming_list[i] * 2       ,hamming_list[j] * 3       ,hamming_list[k] * 5				)				)
								index += 1
				return hamming_list


if __name__ == "__main__":
					SCREAMING_SNAKE_CASE						:						Optional[int]					   =       input('''Enter the last number (nth term) of the Hamming Number Series: ''')
					print('''Formula of Hamming Number Series => 2^i * 3^j * 5^k''')
					SCREAMING_SNAKE_CASE						:						str					   =       hamming(int(n))
					print('''-----------------------------------------------------''')
					print(f'''The list with nth numbers is: {hamming_numbers}''')
					print('''-----------------------------------------------------''')










"""simple docstring"""






from typing import Union

import fire
import torch
from tqdm import tqdm



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__ = "cpu"       ,lowerCAmelCase__ = 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)


