




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case			,     snake_case			,     snake_case       )						->				int:
						_UpperCAmelCase    ,					_UpperCAmelCase      =			len(snake_case       ), len(grid[0]       )
						if (
						    min(snake_case			,     snake_case       ) < 0
						    or row == row_length
						    or col == col_length
						    or (row, col) in visit
						    or grid[row][col] == 1
						):
												return 0
						if row == row_length - 1 and col == col_length - 1:
												return 1

						visit.add((row, col)       )

						_UpperCAmelCase      =			0
						count += depth_first_search(snake_case			,     row + 1			,     snake_case			,     snake_case       )
						count += depth_first_search(snake_case			,     row - 1			,     snake_case			,     snake_case       )
						count += depth_first_search(snake_case			,     snake_case			,     col + 1			,     snake_case       )
						count += depth_first_search(snake_case			,     snake_case			,     col - 1			,     snake_case       )

						visit.remove((row, col)       )
						return count


if __name__ == "__main__":
				import doctest

				doctest.testmod()





from typing import Union

import fire
import torch
from tqdm import tqdm




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case = "cpu"			,     snake_case = None       )						->				None:
						_UpperCAmelCase      =			torch.load(snake_case			,     map_location=snake_case       )
						for k, v in tqdm(state_dict.items()       ):
												if not isinstance(snake_case			,     torch.Tensor       ):
																		raise TypeError("""FP16 conversion only works on paths that are saved state dicts, like pytorch_model.bin"""       )
												_UpperCAmelCase      =			v.half()
						if save_path is None:  # overwrite src_path
												_UpperCAmelCase      =			src_path
						torch.save(snake_case			,     snake_case       )


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