



from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


lowercase_								=     {
    """susnato/ernie-m-base_pytorch""": """https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json""",
    """susnato/ernie-m-large_pytorch""": """https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json""",
}
class 				_snake_case			(					lowercase__):
				UpperCamelCase__				:					Optional[Any]     		="""ernie_m"""
				UpperCamelCase__				:					Dict[str, str]     		={"dropout": "classifier_dropout", "num_classes": "num_labels"}




				def __init__(						self					:						Union[str, Any],					__lowercase					:						int = 25_0002,					__lowercase					:						int = 768,					__lowercase					:						int = 12,					__lowercase					:						int = 12,					__lowercase					:						int = 3072,					__lowercase					:						str = "gelu",					__lowercase					:						float = 0.1,					__lowercase					:						float = 0.1,					__lowercase					:						int = 514,					__lowercase					:						float = 0.02,					__lowercase					:						int = 1,					__lowercase					:						float = 1e-0_5,					__lowercase					:						Tuple=None,					__lowercase					:						Optional[int]=False,					__lowercase					:						Dict=0.0,					**__lowercase					:						int,					):
							super().__init__(pad_token_id=__lowercase,					**__lowercase						)
							lowercase__					  =				vocab_size
							lowercase__					  =				hidden_size
							lowercase__					  =				num_hidden_layers
							lowercase__					  =				num_attention_heads
							lowercase__					  =				intermediate_size
							lowercase__					  =				hidden_act
							lowercase__					  =				hidden_dropout_prob
							lowercase__					  =				attention_probs_dropout_prob
							lowercase__					  =				max_position_embeddings
							lowercase__					  =				initializer_range
							lowercase__					  =				layer_norm_eps
							lowercase__					  =				classifier_dropout
							lowercase__					  =				is_decoder
							lowercase__					  =				act_dropout









def __lowerCAmelCase (     SCREAMING_SNAKE_CASE_						,  SCREAMING_SNAKE_CASE_						,  SCREAMING_SNAKE_CASE_						,  SCREAMING_SNAKE_CASE_  ):
			lowercase__  ,       lowercase__					  =				len(SCREAMING_SNAKE_CASE_  ), len(grid[0]  )
			if (
			    min(SCREAMING_SNAKE_CASE_						,  SCREAMING_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)  )

			lowercase__					  =				0
			count += depth_first_search(SCREAMING_SNAKE_CASE_						,  row + 1						,  SCREAMING_SNAKE_CASE_						,  SCREAMING_SNAKE_CASE_  )
			count += depth_first_search(SCREAMING_SNAKE_CASE_						,  row - 1						,  SCREAMING_SNAKE_CASE_						,  SCREAMING_SNAKE_CASE_  )
			count += depth_first_search(SCREAMING_SNAKE_CASE_						,  SCREAMING_SNAKE_CASE_						,  col + 1						,  SCREAMING_SNAKE_CASE_  )
			count += depth_first_search(SCREAMING_SNAKE_CASE_						,  SCREAMING_SNAKE_CASE_						,  col - 1						,  SCREAMING_SNAKE_CASE_  )

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


if __name__ == "__main__":
							import doctest

							doctest.testmod()




