

def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							if not numbers:
														return 0

							if not isinstance(UpperCamelCase__       ,							(list, tuple)				) or not all(
							    isinstance(UpperCamelCase__       ,							UpperCamelCase__				) for number in numbers				):
														raise ValueError('numbers must be an iterable of integers'				)

							snake_case_          =   snake_case_          =   snake_case_          =   numbers[0]

							for i in range(1       ,							len(UpperCamelCase__				)				):
														# update the maximum and minimum subarray products
														snake_case_          =   numbers[i]
														if number < 0:
																					snake_case_    ,   snake_case_          =   min_till_now, max_till_now
														snake_case_          =   max(UpperCamelCase__       ,							max_till_now * number				)
														snake_case_          =   min(UpperCamelCase__       ,							min_till_now * number				)

														# update the maximum product found till now
														snake_case_          =   max(UpperCamelCase__       ,							UpperCamelCase__				)

							return max_prod







import unittest

from transformers import is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device


if is_torch_available():
					import torch

					from transformers import AutoModelForImageClassification

if is_vision_available():
					from transformers import AutoImageProcessor







@require_torch
@require_vision
class 			lowercase    (	unittest.TestCase      ):




				@slow
				def    a							( self	):
											snake_case_          =   AutoImageProcessor.from_pretrained('microsoft/dit-base-finetuned-rvlcdip'	)
											snake_case_          =   AutoModelForImageClassification.from_pretrained('microsoft/dit-base-finetuned-rvlcdip'	)
											model.to(snake_case	)

											from datasets import load_dataset

											snake_case_          =   load_dataset('nielsr/rvlcdip-demo'	)

											snake_case_          =   dataset['train'][0]['image'].convert('RGB'	)

											snake_case_          =   image_processor(snake_case				,       return_tensors='pt'	).to(snake_case	)

											# forward pass
											with torch.no_grad():
																		snake_case_          =   model(**snake_case	)
																		snake_case_          =   outputs.logits

											snake_case_          =   torch.Size((1, 16)	)
											self.assertEqual(logits.shape				,       snake_case	)

											snake_case_          =   torch.tensor(
											    [-0.41_58, -0.40_92, -0.43_47]				,       device=snake_case				,       dtype=torch.float				,       )
											self.assertTrue(torch.allclose(logits[0, :3]				,       snake_case				,       atol=1e-4	)	)




