
"""simple docstring"""





import os




def 	UpperCAmelCase     (		A	:						Tuple       ):

		'''simple docstring'''


		_UpperCAmelCase							 =		len(grid[0]       )
		_UpperCAmelCase							 =		len(_A       )

		_UpperCAmelCase							 =		0
		_UpperCAmelCase							 =		0
		_UpperCAmelCase							 =		0

		# Check vertically, horizontally, diagonally at the same time (only works
		# for nxn grid)
		for i in range(_A       ):
				for j in range(n_rows - 3       ):
						_UpperCAmelCase							 =		grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
						_UpperCAmelCase							 =		grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3]

						# Left-to-right diagonal (\) product
						if i < n_columns - 3:
								_UpperCAmelCase							 =		(
								    grid[i][j]
								    * grid[i + 1][j + 1]
								    * grid[i + 2][j + 2]
								    * grid[i + 3][j + 3]
								)

						# Right-to-left diagonal(/) product
						if i > 2:
								_UpperCAmelCase							 =		(
								    grid[i][j]
								    * grid[i - 1][j + 1]
								    * grid[i - 2][j + 2]
								    * grid[i - 3][j + 3]
								)

						_UpperCAmelCase							 =		max(
						    _A     ,				_A     ,				_A     ,				_A       )
						if max_product > largest:
								_UpperCAmelCase							 =		max_product

		return largest




def 	UpperCAmelCase     (		):

		'''simple docstring'''


		_UpperCAmelCase							 =		[]
		with open(os.path.dirname(_A       ) + '/grid.txt'       ) as file:
				for line in file:
						grid.append(line.strip('\n'       ).split(' '       )       )

		_UpperCAmelCase							 =		[[int(_A       ) for i in grid[j]] for j in range(len(_A       )       )]

		return largest_product(_A       )


if __name__ == "__main__":
					print(solution())







"""simple docstring"""





from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowercase  							=					logging.get_logger(__name__)

lowercase  							=					{
    '''microsoft/swin-tiny-patch4-window7-224''': (
        '''https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json'''
    ),
    # See all Swin models at https://huggingface.co/models?filter=swin
}




class 			lowercase__			(      A,					A    ):
							'''simple docstring'''







							_UpperCAmelCase      				=					'''swin'''

							_UpperCAmelCase      				=					{
							    '''num_attention_heads''': '''num_heads''',
							    '''num_hidden_layers''': '''num_layers''',
							}






							def __init__(  self	,       snake_case=224	,       snake_case=4	,       snake_case=3	,       snake_case=96	,       snake_case=[2, 2, 6, 2]	,       snake_case=[3, 6, 12, 24]	,       snake_case=7	,       snake_case=4.0	,       snake_case=True	,       snake_case=0.0	,       snake_case=0.0	,       snake_case=0.1	,       snake_case="gelu"	,       snake_case=False	,       snake_case=0.02	,       snake_case=1E-5	,       snake_case=32	,       snake_case=None	,       snake_case=None	,       **snake_case	,       )			->							List[Any]:
									super().__init__(**snake_case						)

									_UpperCAmelCase							 =		image_size
									_UpperCAmelCase							 =		patch_size
									_UpperCAmelCase							 =		num_channels
									_UpperCAmelCase							 =		embed_dim
									_UpperCAmelCase							 =		depths
									_UpperCAmelCase							 =		len(snake_case						)
									_UpperCAmelCase							 =		num_heads
									_UpperCAmelCase							 =		window_size
									_UpperCAmelCase							 =		mlp_ratio
									_UpperCAmelCase							 =		qkv_bias
									_UpperCAmelCase							 =		hidden_dropout_prob
									_UpperCAmelCase							 =		attention_probs_dropout_prob
									_UpperCAmelCase							 =		drop_path_rate
									_UpperCAmelCase							 =		hidden_act
									_UpperCAmelCase							 =		use_absolute_embeddings
									_UpperCAmelCase							 =		layer_norm_eps
									_UpperCAmelCase							 =		initializer_range
									_UpperCAmelCase							 =		encoder_stride
									# we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
									# this indicates the channel dimension after the last stage of the model
									_UpperCAmelCase							 =		int(embed_dim * 2 ** (len(snake_case						) - 1)						)
									_UpperCAmelCase							 =		['stem'] + [f'stage{idx}' for idx in range(1	,       len(snake_case						) + 1						)]
									_UpperCAmelCase ,					_UpperCAmelCase							 =		get_aligned_output_features_output_indices(
									    out_features=snake_case	,       out_indices=snake_case	,       stage_names=self.stage_names						)







class 			lowercase__			(      A    ):
							'''simple docstring'''







							_UpperCAmelCase      				=					version.parse('''1.11'''    )






							@property
							def        lowerCamelCase_   (  self						)			->							Mapping[str, Mapping[int, str]]:
									return OrderedDict(
									    [
									        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
									    ]						)






							@property
							def        lowerCamelCase_   (  self						)			->							float:
									return 1E-4


