






from typing import Union

import fire
import torch
from tqdm import tqdm






def 							A     (       a_							,a_ = "cpu"							,a_ = None					)     ->						None:
					__UpperCamelCase      :					Tuple       		=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      :					Optional[int]       		=v.half()
					if save_path is None:  # overwrite src_path
										__UpperCamelCase      :					int       		=src_path
					torch.save(a_							,a_					)


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


"""simple docstring"""




def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       Any	)       ->      List[Any]:  # noqa: E741
  _lowerCAmelCase						:       Optional[int]  			=     len(_lowerCamelCase	)
  _lowerCAmelCase						:       str  			=     0
  _lowerCAmelCase						:       Any  			=     [0] * n
  _lowerCAmelCase						:       str  			=     [False] * n
  _lowerCAmelCase						:       str  			=     [False] * n

  def dfs(_lowerCamelCase						:       Tuple			,_lowerCamelCase						:       Union[str, Any]			,_lowerCamelCase						:       Union[str, Any]			,_lowerCamelCase						:       str	):
    if parent == root:
      out_edge_count += 1
    _lowerCAmelCase						:       Any  			=     True
    _lowerCAmelCase						:       int  			=     at

    for to in l[at]:
      if to == parent:
        pass
      elif not visited[to]:
        _lowerCAmelCase						:       Union[str, Any]  			=     dfs(_lowerCamelCase			,_lowerCamelCase			,_lowerCamelCase			,_lowerCamelCase	)
        _lowerCAmelCase						:       Optional[int]  			=     min(low[at]			,low[to]	)

        # AP found via bridge
        if at < low[to]:
          _lowerCAmelCase						:       int  			=     True
        # AP found via cycle
        if at == low[to]:
          _lowerCAmelCase						:       Tuple  			=     True
      else:
        _lowerCAmelCase						:       Union[str, Any]  			=     min(low[at]			,_lowerCamelCase	)
    return out_edge_count

  for i in range(_lowerCamelCase	):
    if not visited[i]:
      _lowerCAmelCase						:       int  			=     0
      _lowerCAmelCase						:       Dict  			=     dfs(_lowerCamelCase			,_lowerCamelCase			,-1			,_lowerCamelCase	)
      _lowerCAmelCase						:       List[str]  			=     out_edge_count > 1

  for x in range(len(_lowerCamelCase	)	):
    if is_art[x] is True:
      print(_lowerCamelCase	)


# Adjacency list of graph
_a      :		Optional[Any]           =   {
    0: [1, 2],
    1: [0, 2],
    2: [0, 1, 3, 5],
    3: [2, 4],
    4: [3],
    5: [2, 6, 8],
    6: [5, 7],
    7: [6, 8],
    8: [5, 7],
}






compute_ap(data)




