


"""simple docstring"""
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        __A       (unittest.TestCase):





							'''simple docstring'''

							@slow
							def 						lowerCAmelCase    (			self							: List[Any]    )   ->Optional[Any]:



														"""simple docstring"""



														snake_case_          =						AutoImageProcessor.from_pretrained("""microsoft/dit-base-finetuned-rvlcdip"""    )
														snake_case_          =						AutoModelForImageClassification.from_pretrained("""microsoft/dit-base-finetuned-rvlcdip"""    )
														model.to(UpperCAmelCase_    )

														from datasets import load_dataset

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

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

														snake_case_          =						image_processor(UpperCAmelCase_						,    return_tensors="""pt"""    ).to(UpperCAmelCase_    )

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

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

														snake_case_          =						torch.tensor(
														    [-0.4_158, -0.4_092, -0.4_347]						,    device=UpperCAmelCase_						,    dtype=torch.float						,    )
														self.assertTrue(torch.allclose(logits[0, :3]						,    UpperCAmelCase_						,    atol=1E-4    )    )







"""simple docstring"""
def   _a			( _SCREAMING_SNAKE_CASE			,	_SCREAMING_SNAKE_CASE			)      ->			str:
							return "\n".join(
							    f"""{number} * {i} = {number * i}""" for i in range(1			,	number_of_terms + 1			)			)


if __name__ == "__main__":
				print(multiplication_table(number=5, number_of_terms=10))



