
from typing import Union

import fire
import torch
from tqdm import tqdm

def a__    (       A_,     A_ = "cpu",     A_ = None					):






  '''simple docstring'''





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


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



def a__    (       A_					):






  '''simple docstring'''





  if not isinstance(A_,     A_					):
    raise ValueError("""Input series is not valid, valid series - [2, 4, 6]"""					)
  if len(A_					) == 0:
    raise ValueError("""Input list must be a non empty list"""					)
  if len(A_					) == 1:
    return True
  __magic_name__				     =       series[1] - series[0]
  for index in range(len(A_					) - 1					):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True

def a__    (       A_					):






  '''simple docstring'''





  if not isinstance(A_,     A_					):
    raise ValueError("""Input series is not valid, valid series - [2, 4, 6]"""					)
  if len(A_					) == 0:
    raise ValueError("""Input list must be a non empty list"""					)
  __magic_name__				     =       0
  for val in series:
    answer += val
  return answer / len(A_					)


if __name__ == "__main__":
    import doctest

    doctest.testmod()

