





import sacrebleu as scb
from packaging import version
from sacrebleu import CHRF

import datasets


_A :   List[str]  			=  '\\n@inproceedings{popovic-2015-chrf,\n    title = "chr{F}: character n-gram {F}-score for automatic {MT} evaluation",\n    author = "Popovi{\'c}, Maja",\n    booktitle = "Proceedings of the Tenth Workshop on Statistical Machine Translation",\n    month = sep,\n    year = "2015",\n    address = "Lisbon, Portugal",\n    publisher = "Association for Computational Linguistics",\n    url = "https://aclanthology.org/W15-3049",\n    doi = "10.18653/v1/W15-3049",\n    pages = "392--395",\n}\n@inproceedings{popovic-2017-chrf,\n    title = "chr{F}++: words helping character n-grams",\n    author = "Popovi{\'c}, Maja",\n    booktitle = "Proceedings of the Second Conference on Machine Translation",\n    month = sep,\n    year = "2017",\n    address = "Copenhagen, Denmark",\n    publisher = "Association for Computational Linguistics",\n    url = "https://aclanthology.org/W17-4770",\n    doi = "10.18653/v1/W17-4770",\n    pages = "612--618",\n}\n@inproceedings{post-2018-call,\n    title = "A Call for Clarity in Reporting {BLEU} Scores",\n    author = "Post, Matt",\n    booktitle = "Proceedings of the Third Conference on Machine Translation: Research Papers",\n    month = oct,\n    year = "2018",\n    address = "Belgium, Brussels",\n    publisher = "Association for Computational Linguistics",\n    url = "https://www.aclweb.org/anthology/W18-6319",\n    pages = "186--191",\n}\n'

_A :   List[str]  			=  '\\nChrF and ChrF++ are two MT evaluation metrics. They both use the F-score statistic for character n-gram matches,\nand ChrF++ adds word n-grams as well which correlates more strongly with direct assessment. We use the implementation\nthat is already present in sacrebleu.\n\nThe implementation here is slightly different from sacrebleu in terms of the required input format. The length of\nthe references and hypotheses lists need to be the same, so you may need to transpose your references compared to\nsacrebleu\'s required input format. See https://github.com/huggingface/datasets/issues/3154#issuecomment-950746534\n\nSee the README.md file at https://github.com/mjpost/sacreBLEU#chrf--chrf for more information.\n'

_A :   Tuple  			=  '\nProduces ChrF(++) scores for hypotheses given reference translations.\n\nArgs:\n    predictions (list of str): The predicted sentences.\n    references (list of list of str): The references. There should be one reference sub-list for each prediction sentence.\n    char_order (int): Character n-gram order. Defaults to `6`.\n    word_order (int): Word n-gram order. If equals to `2`, the metric is referred to as chrF++. Defaults to `0`.\n    beta (int): Determine the importance of recall w.r.t precision. Defaults to `2`.\n    lowercase (bool): if `True`, enables case-insensitivity. Defaults to `False`.\n    whitespace (bool): If `True`, include whitespaces when extracting character n-grams.\n    eps_smoothing (bool): If `True`, applies epsilon smoothing similar\n    to reference chrF++.py, NLTK and Moses implementations. If `False`,\n    it takes into account effective match order similar to sacreBLEU < 2.0.0. Defaults to `False`.\n\nReturns:\n    \'score\' (float): The chrF (chrF++) score,\n    \'char_order\' (int): The character n-gram order,\n    \'word_order\' (int): The word n-gram order. If equals to 2, the metric is referred to as chrF++,\n    \'beta\' (int): Determine the importance of recall w.r.t precision\n\nExamples:\n    Example 1--a simple example of calculating chrF:\n        >>> prediction = ["The relationship between cats and dogs is not exactly friendly.", "a good bookshop is just a genteel black hole that knows how to read."]\n        >>> reference = [["The relationship between dogs and cats is not exactly friendly."], ["A good bookshop is just a genteel Black Hole that knows how to read."]]\n        >>> chrf = datasets.load_metric("chrf")\n        >>> results = chrf.compute(predictions=prediction, references=reference)\n        >>> print(results)\n        {\'score\': 84.64214891738334, \'char_order\': 6, \'word_order\': 0, \'beta\': 2}\n\n    Example 2--the same example, but with the argument word_order=2, to calculate chrF++ instead of chrF:\n        >>> prediction = ["The relationship between cats and dogs is not exactly friendly.", "a good bookshop is just a genteel black hole that knows how to read."]\n        >>> reference = [["The relationship between dogs and cats is not exactly friendly."], ["A good bookshop is just a genteel Black Hole that knows how to read."]]\n        >>> chrf = datasets.load_metric("chrf")\n        >>> results = chrf.compute(predictions=prediction,\n        ...                         references=reference,\n        ...                         word_order=2)\n        >>> print(results)\n        {\'score\': 82.87263732906315, \'char_order\': 6, \'word_order\': 2, \'beta\': 2}\n\n    Example 3--the same chrF++ example as above, but with `lowercase=True` to normalize all case:\n        >>> prediction = ["The relationship between cats and dogs is not exactly friendly.", "a good bookshop is just a genteel black hole that knows how to read."]\n        >>> reference = [["The relationship between dogs and cats is not exactly friendly."], ["A good bookshop is just a genteel Black Hole that knows how to read."]]\n        >>> chrf = datasets.load_metric("chrf")\n        >>> results = chrf.compute(predictions=prediction,\n        ...                         references=reference,\n        ...                         word_order=2,\n        ...                         lowercase=True)\n        >>> print(results)\n        {\'score\': 92.12853119829202, \'char_order\': 6, \'word_order\': 2, \'beta\': 2}\n'


@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION					,_KWARGS_DESCRIPTION )
class        __SCREAMING_SNAKE_CASE      (			datasets.Metric ):







       def 						__lowerCamelCase   (				self					:     List[str]      )       ->str:
          if version.parse(scb.__version__      ) < version.parse('''1.4.12'''      ):
             raise ImportWarning(
                 '''To use `sacrebleu`, the module `sacrebleu>=1.4.12` is required, and the current version of `sacrebleu` doesn\'t match this condition.\n'''
                 '''You can install it with `pip install "sacrebleu>=1.4.12"`.'''      )
          return datasets.MetricInfo(
              description=_DESCRIPTION		, citation=_CITATION		, homepage='''https://github.com/mjpost/sacreBLEU#chrf--chrf'''		, inputs_description=_KWARGS_DESCRIPTION		, features=datasets.Features(
                  {
                      '''predictions''': datasets.Value('''string'''		, id='''sequence'''      ),
                      '''references''': datasets.Sequence(datasets.Value('''string'''		, id='''sequence'''      )		, id='''references'''      ),
                  }      )		, codebase_urls=['''https://github.com/mjpost/sacreBLEU#chrf--chrf''']		, reference_urls=[
                  '''https://github.com/m-popovic/chrF''',
              ]		, )







       def 						__lowerCamelCase   (				self					:     Optional[int]		, A					:     Tuple		, A					:     List[str]		, A					:     int = CHRF.CHAR_ORDER		, A					:     int = CHRF.WORD_ORDER		, A					:     int = CHRF.BETA		, A					:     bool = False		, A					:     bool = False		, A					:     bool = False		, )       ->List[str]:
          lowerCamelCase__       :						List[str]        =							len(references[0]      )
          if any(len(A      ) != references_per_prediction for refs in references      ):
             raise ValueError('''Sacrebleu requires the same number of references for each prediction'''      )
          lowerCamelCase__       :						str        =							[[refs[i] for refs in references] for i in range(A      )]

          lowerCamelCase__       :						List[Any]        =							CHRF(A		, A		, A		, A		, A		, A      )
          lowerCamelCase__       :						Optional[Any]        =							sb_chrf.corpus_score(A		, A      )

          return {
              "score": output.score,
              "char_order": output.char_order,
              "word_order": output.word_order,
              "beta": output.beta,
          }










import json
import pathlib
import unittest

import numpy as np

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

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
       import torch

if is_vision_available():
       from PIL import Image

       from transformers import DetrImageProcessor


class        __SCREAMING_SNAKE_CASE      (			unittest.TestCase ):







       def __init__(				self					:     Optional[int]		, A					:     Union[str, Any]		, A					:     Any=7		, A					:     Optional[int]=3		, A					:     Tuple=3_0		, A					:     List[Any]=4_0_0		, A					:     str=True		, A					:     Optional[int]=None		, A					:     Tuple=True		, A					:     Union[str, Any]=1 / 2_5_5		, A					:     Any=True		, A					:     Optional[int]=[0.5, 0.5, 0.5]		, A					:     Optional[int]=[0.5, 0.5, 0.5]		, A					:     str=True		, )       ->List[Any]:
          # by setting size["longest_edge"] > max_resolution we're effectively not testing this :p
          lowerCamelCase__       :						Union[str, Any]        =							size if size is not None else {'''shortest_edge''': 1_8, '''longest_edge''': 1_3_3_3}
          lowerCamelCase__       :						List[str]        =							parent
          lowerCamelCase__       :						Union[str, Any]        =							batch_size
          lowerCamelCase__       :						int        =							num_channels
          lowerCamelCase__       :						Optional[Any]        =							min_resolution
          lowerCamelCase__       :						List[Any]        =							max_resolution
          lowerCamelCase__       :						int        =							do_resize
          lowerCamelCase__       :						List[str]        =							size
          lowerCamelCase__       :						Union[str, Any]        =							do_rescale
          lowerCamelCase__       :						Optional[int]        =							rescale_factor
          lowerCamelCase__       :						List[str]        =							do_normalize
          lowerCamelCase__       :						Tuple        =							image_mean
          lowerCamelCase__       :						str        =							image_std
          lowerCamelCase__       :						List[Any]        =							do_pad







       def 						__lowerCamelCase   (				self					:     List[str]      )       ->Dict:
          return {
              "do_resize": self.do_resize,
              "size": self.size,
              "do_rescale": self.do_rescale,
              "rescale_factor": self.rescale_factor,
              "do_normalize": self.do_normalize,
              "image_mean": self.image_mean,
              "image_std": self.image_std,
              "do_pad": self.do_pad,
          }







       def 						__lowerCamelCase   (				self					:     Tuple		, A					:     int		, A					:     List[str]=False      )       ->int:
          if not batched:
             lowerCamelCase__       :						Union[str, Any]        =							image_inputs[0]
             if isinstance(A		, Image.Image      ):
                lowerCamelCase__       ,							lowerCamelCase__       :						Union[str, Any]        =							image.size
             else:
                lowerCamelCase__       ,							lowerCamelCase__       :						Optional[int]        =							image.shape[1], image.shape[2]
             if w < h:
                lowerCamelCase__       :						List[Any]        =							int(self.size['''shortest_edge'''] * h / w      )
                lowerCamelCase__       :						List[Any]        =							self.size['''shortest_edge''']
             elif w > h:
                lowerCamelCase__       :						List[Any]        =							self.size['''shortest_edge''']
                lowerCamelCase__       :						Dict        =							int(self.size['''shortest_edge'''] * w / h      )
             else:
                lowerCamelCase__       :						List[Any]        =							self.size['''shortest_edge''']
                lowerCamelCase__       :						Any        =							self.size['''shortest_edge''']

          else:
             lowerCamelCase__       :						Optional[Any]        =							[]
             for image in image_inputs:
                lowerCamelCase__       ,							lowerCamelCase__       :						Any        =							self.get_expected_values([image]      )
                expected_values.append((expected_height, expected_width)      )
             lowerCamelCase__       :						Dict        =							max(A		, key=lambda A      : item[0]      )[0]
             lowerCamelCase__       :						Dict        =							max(A		, key=lambda A      : item[1]      )[1]

          return expected_height, expected_width


@require_torch
@require_vision
class        __SCREAMING_SNAKE_CASE      (			lowerCAmelCase_					,unittest.TestCase ):
       _UpperCAmelCase				:  Optional[Any]			   =   DetrImageProcessor if is_vision_available() else None







       def 						__lowerCamelCase   (				self					:     Optional[int]      )       ->Dict:
          lowerCamelCase__       :						Optional[int]        =							DetrImageProcessingTester(self      )







       @property
       def 						__lowerCamelCase   (				self					:     Dict      )       ->Any:
          return self.image_processor_tester.prepare_image_processor_dict()







       def 						__lowerCamelCase   (				self					:     int      )       ->Union[str, Any]:
          lowerCamelCase__       :						Optional[Any]        =							self.image_processing_class(**self.image_processor_dict      )
          self.assertTrue(hasattr(A		, '''image_mean'''      )      )
          self.assertTrue(hasattr(A		, '''image_std'''      )      )
          self.assertTrue(hasattr(A		, '''do_normalize'''      )      )
          self.assertTrue(hasattr(A		, '''do_rescale'''      )      )
          self.assertTrue(hasattr(A		, '''rescale_factor'''      )      )
          self.assertTrue(hasattr(A		, '''do_resize'''      )      )
          self.assertTrue(hasattr(A		, '''size'''      )      )
          self.assertTrue(hasattr(A		, '''do_pad'''      )      )







       def 						__lowerCamelCase   (				self					:     int      )       ->Union[str, Any]:
          lowerCamelCase__       :						List[Any]        =							self.image_processing_class.from_dict(self.image_processor_dict      )
          self.assertEqual(image_processor.size		, {'''shortest_edge''': 1_8, '''longest_edge''': 1_3_3_3}      )
          self.assertEqual(image_processor.do_pad		, A      )

          lowerCamelCase__       :						str        =							self.image_processing_class.from_dict(
              self.image_processor_dict		, size=4_2		, max_size=8_4		, pad_and_return_pixel_mask=A      )
          self.assertEqual(image_processor.size		, {'''shortest_edge''': 4_2, '''longest_edge''': 8_4}      )
          self.assertEqual(image_processor.do_pad		, A      )







       def 						__lowerCamelCase   (				self					:     Union[str, Any]      )       ->Optional[Any]:
          pass







       def 						__lowerCamelCase   (				self					:     str      )       ->Optional[Any]:
          # Initialize image_processing
          lowerCamelCase__       :						Any        =							self.image_processing_class(**self.image_processor_dict      )
          # create random PIL images
          lowerCamelCase__       :						str        =							prepare_image_inputs(self.image_processor_tester		, equal_resolution=A      )
          for image in image_inputs:
             self.assertIsInstance(A		, Image.Image      )

          # Test not batched input
          lowerCamelCase__       :						Optional[Any]        =							image_processing(image_inputs[0]		, return_tensors='''pt'''      ).pixel_values

          lowerCamelCase__       ,							lowerCamelCase__       :						str        =							self.image_processor_tester.get_expected_values(A      )

          self.assertEqual(
              encoded_images.shape		, (1, self.image_processor_tester.num_channels, expected_height, expected_width)		, )

          # Test batched
          lowerCamelCase__       ,							lowerCamelCase__       :						int        =							self.image_processor_tester.get_expected_values(A		, batched=A      )

          lowerCamelCase__       :						Any        =							image_processing(A		, return_tensors='''pt'''      ).pixel_values
          self.assertEqual(
              encoded_images.shape		, (
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_channels,
                  expected_height,
                  expected_width,
              )		, )







       def 						__lowerCamelCase   (				self					:     List[str]      )       ->List[str]:
          # Initialize image_processing
          lowerCamelCase__       :						Any        =							self.image_processing_class(**self.image_processor_dict      )
          # create random numpy tensors
          lowerCamelCase__       :						int        =							prepare_image_inputs(self.image_processor_tester		, equal_resolution=A		, numpify=A      )
          for image in image_inputs:
             self.assertIsInstance(A		, np.ndarray      )

          # Test not batched input
          lowerCamelCase__       :						List[str]        =							image_processing(image_inputs[0]		, return_tensors='''pt'''      ).pixel_values

          lowerCamelCase__       ,							lowerCamelCase__       :						str        =							self.image_processor_tester.get_expected_values(A      )

          self.assertEqual(
              encoded_images.shape		, (1, self.image_processor_tester.num_channels, expected_height, expected_width)		, )

          # Test batched
          lowerCamelCase__       :						List[Any]        =							image_processing(A		, return_tensors='''pt'''      ).pixel_values

          lowerCamelCase__       ,							lowerCamelCase__       :						Optional[Any]        =							self.image_processor_tester.get_expected_values(A		, batched=A      )

          self.assertEqual(
              encoded_images.shape		, (
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_channels,
                  expected_height,
                  expected_width,
              )		, )







       def 						__lowerCamelCase   (				self					:     Any      )       ->Any:
          # Initialize image_processing
          lowerCamelCase__       :						Optional[Any]        =							self.image_processing_class(**self.image_processor_dict      )
          # create random PyTorch tensors
          lowerCamelCase__       :						List[str]        =							prepare_image_inputs(self.image_processor_tester		, equal_resolution=A		, torchify=A      )
          for image in image_inputs:
             self.assertIsInstance(A		, torch.Tensor      )

          # Test not batched input
          lowerCamelCase__       :						str        =							image_processing(image_inputs[0]		, return_tensors='''pt'''      ).pixel_values

          lowerCamelCase__       ,							lowerCamelCase__       :						str        =							self.image_processor_tester.get_expected_values(A      )

          self.assertEqual(
              encoded_images.shape		, (1, self.image_processor_tester.num_channels, expected_height, expected_width)		, )

          # Test batched
          lowerCamelCase__       :						str        =							image_processing(A		, return_tensors='''pt'''      ).pixel_values

          lowerCamelCase__       ,							lowerCamelCase__       :						str        =							self.image_processor_tester.get_expected_values(A		, batched=A      )

          self.assertEqual(
              encoded_images.shape		, (
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_channels,
                  expected_height,
                  expected_width,
              )		, )







       @slow
       def 						__lowerCamelCase   (				self					:     Tuple      )       ->List[Any]:
          # prepare image and target
          lowerCamelCase__       :						Union[str, Any]        =							Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''      )
          with open('''./tests/fixtures/tests_samples/COCO/coco_annotations.txt'''		, '''r'''      ) as f:
             lowerCamelCase__       :						Union[str, Any]        =							json.loads(f.read()      )

          lowerCamelCase__       :						List[str]        =							{'''image_id''': 3_9_7_6_9, '''annotations''': target}

          # encode them
          lowerCamelCase__       :						Optional[int]        =							DetrImageProcessor.from_pretrained('''facebook/detr-resnet-50'''      )
          lowerCamelCase__       :						List[Any]        =							image_processing(images=A		, annotations=A		, return_tensors='''pt'''      )

          # verify pixel values
          lowerCamelCase__       :						Optional[int]        =							torch.Size([1, 3, 8_0_0, 1_0_6_6]      )
          self.assertEqual(encoding['''pixel_values'''].shape		, A      )

          lowerCamelCase__       :						Any        =							torch.tensor([0.27_96, 0.31_38, 0.34_81]      )
          self.assertTrue(torch.allclose(encoding['''pixel_values'''][0, 0, 0, :3]		, A		, atol=1e-4      )      )

          # verify area
          lowerCamelCase__       :						Dict        =							torch.tensor([58_87.96_00, 1_12_50.20_61, 48_93_53.84_38, 83_71_22.75_00, 14_79_67.51_56, 16_57_32.34_38]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''area''']		, A      )      )
          # verify boxes
          lowerCamelCase__       :						Any        =							torch.Size([6, 4]      )
          self.assertEqual(encoding['''labels'''][0]['''boxes'''].shape		, A      )
          lowerCamelCase__       :						str        =							torch.tensor([0.55_03, 0.27_65, 0.06_04, 0.22_15]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''boxes'''][0]		, A		, atol=1e-3      )      )
          # verify image_id
          lowerCamelCase__       :						str        =							torch.tensor([3_9_7_6_9]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''image_id''']		, A      )      )
          # verify is_crowd
          lowerCamelCase__       :						List[str]        =							torch.tensor([0, 0, 0, 0, 0, 0]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''iscrowd''']		, A      )      )
          # verify class_labels
          lowerCamelCase__       :						List[Any]        =							torch.tensor([7_5, 7_5, 6_3, 6_5, 1_7, 1_7]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''class_labels''']		, A      )      )
          # verify orig_size
          lowerCamelCase__       :						str        =							torch.tensor([4_8_0, 6_4_0]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''orig_size''']		, A      )      )
          # verify size
          lowerCamelCase__       :						str        =							torch.tensor([8_0_0, 1_0_6_6]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''size''']		, A      )      )







       @slow
       def 						__lowerCamelCase   (				self					:     Optional[Any]      )       ->List[str]:
          # prepare image, target and masks_path
          lowerCamelCase__       :						Any        =							Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''      )
          with open('''./tests/fixtures/tests_samples/COCO/coco_panoptic_annotations.txt'''		, '''r'''      ) as f:
             lowerCamelCase__       :						Optional[Any]        =							json.loads(f.read()      )

          lowerCamelCase__       :						Union[str, Any]        =							{'''file_name''': '''000000039769.png''', '''image_id''': 3_9_7_6_9, '''segments_info''': target}

          lowerCamelCase__       :						List[Any]        =							pathlib.Path('''./tests/fixtures/tests_samples/COCO/coco_panoptic'''      )

          # encode them
          lowerCamelCase__       :						Any        =							DetrImageProcessor.from_pretrained('''facebook/detr-resnet-50-panoptic'''      )
          lowerCamelCase__       :						Tuple        =							image_processing(images=A		, annotations=A		, masks_path=A		, return_tensors='''pt'''      )

          # verify pixel values
          lowerCamelCase__       :						Optional[Any]        =							torch.Size([1, 3, 8_0_0, 1_0_6_6]      )
          self.assertEqual(encoding['''pixel_values'''].shape		, A      )

          lowerCamelCase__       :						str        =							torch.tensor([0.27_96, 0.31_38, 0.34_81]      )
          self.assertTrue(torch.allclose(encoding['''pixel_values'''][0, 0, 0, :3]		, A		, atol=1e-4      )      )

          # verify area
          lowerCamelCase__       :						int        =							torch.tensor([14_79_79.68_75, 16_55_27.04_69, 48_46_38.59_38, 1_12_92.93_75, 58_79.65_62, 76_34.11_47]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''area''']		, A      )      )
          # verify boxes
          lowerCamelCase__       :						Optional[Any]        =							torch.Size([6, 4]      )
          self.assertEqual(encoding['''labels'''][0]['''boxes'''].shape		, A      )
          lowerCamelCase__       :						Optional[Any]        =							torch.tensor([0.26_25, 0.54_37, 0.46_88, 0.86_25]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''boxes'''][0]		, A		, atol=1e-3      )      )
          # verify image_id
          lowerCamelCase__       :						int        =							torch.tensor([3_9_7_6_9]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''image_id''']		, A      )      )
          # verify is_crowd
          lowerCamelCase__       :						Dict        =							torch.tensor([0, 0, 0, 0, 0, 0]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''iscrowd''']		, A      )      )
          # verify class_labels
          lowerCamelCase__       :						int        =							torch.tensor([1_7, 1_7, 6_3, 7_5, 7_5, 9_3]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''class_labels''']		, A      )      )
          # verify masks
          lowerCamelCase__       :						Union[str, Any]        =							8_2_2_8_7_3
          self.assertEqual(encoding['''labels'''][0]['''masks'''].sum().item()		, A      )
          # verify orig_size
          lowerCamelCase__       :						List[Any]        =							torch.tensor([4_8_0, 6_4_0]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''orig_size''']		, A      )      )
          # verify size
          lowerCamelCase__       :						Tuple        =							torch.tensor([8_0_0, 1_0_6_6]      )
          self.assertTrue(torch.allclose(encoding['''labels'''][0]['''size''']		, A      )      )



