'''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     __UpperCAmelCase       ( unittest.TestCase		):





  @slow
  def 						UpperCAmelCase_	(	self ):
     lowerCAmelCase_			=      AutoImageProcessor.from_pretrained('''microsoft/dit-base-finetuned-rvlcdip''' )
     lowerCAmelCase_			=      AutoModelForImageClassification.from_pretrained('''microsoft/dit-base-finetuned-rvlcdip''' )
     model.to(_lowerCamelCase )

     from datasets import load_dataset

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

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

     lowerCAmelCase_			=      image_processor(_lowerCamelCase    ,     return_tensors='''pt''' ).to(_lowerCamelCase )

     # forward pass
     with torch.no_grad():
        lowerCAmelCase_			=      model(**_lowerCamelCase )
        lowerCAmelCase_			=      outputs.logits

     lowerCAmelCase_			=      torch.Size((1, 16) )
     self.assertEqual(logits.shape    ,     _lowerCamelCase )

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






'''simple docstring'''

def snake_case_      (					__snake_case  :							int = 200)			->					int:
   lowerCAmelCase_			=      [1, 2, 5, 10, 20, 50, 100, 200]
   lowerCAmelCase_			=      [0] * (pence + 1)
   lowerCAmelCase_			=      1  # base case: 1 way to make 0 pence

   for coin in coins:
      for i in range(__snake_case	,   pence + 1	,   1):
         number_of_ways[i] += number_of_ways[i - coin]
   return number_of_ways[pence]


if __name__ == "__main__":
 assert solution(2_00) == 7_36_82





