





'''simple docstring'''






import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_distilbert import DistilBertTokenizer


lowerCAmelCase       		=      logging.get_logger(__name__)

lowerCAmelCase       		=      {"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

lowerCAmelCase       		=      {
    """vocab_file""": {
        """distilbert-base-uncased""": """https://huggingface.co/distilbert-base-uncased/resolve/main/vocab.txt""",
        """distilbert-base-uncased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/vocab.txt"""
        ),
        """distilbert-base-cased""": """https://huggingface.co/distilbert-base-cased/resolve/main/vocab.txt""",
        """distilbert-base-cased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/vocab.txt"""
        ),
        """distilbert-base-german-cased""": """https://huggingface.co/distilbert-base-german-cased/resolve/main/vocab.txt""",
        """distilbert-base-multilingual-cased""": (
            """https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """distilbert-base-uncased""": """https://huggingface.co/distilbert-base-uncased/resolve/main/tokenizer.json""",
        """distilbert-base-uncased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-cased""": """https://huggingface.co/distilbert-base-cased/resolve/main/tokenizer.json""",
        """distilbert-base-cased-distilled-squad""": (
            """https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-german-cased""": (
            """https://huggingface.co/distilbert-base-german-cased/resolve/main/tokenizer.json"""
        ),
        """distilbert-base-multilingual-cased""": (
            """https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/tokenizer.json"""
        ),
    },
}

lowerCAmelCase       		=      {
    """distilbert-base-uncased""": 5_12,
    """distilbert-base-uncased-distilled-squad""": 5_12,
    """distilbert-base-cased""": 5_12,
    """distilbert-base-cased-distilled-squad""": 5_12,
    """distilbert-base-german-cased""": 5_12,
    """distilbert-base-multilingual-cased""": 5_12,
}


lowerCAmelCase       		=      {
    """distilbert-base-uncased""": {"""do_lower_case""": True},
    """distilbert-base-uncased-distilled-squad""": {"""do_lower_case""": True},
    """distilbert-base-cased""": {"""do_lower_case""": False},
    """distilbert-base-cased-distilled-squad""": {"""do_lower_case""": False},
    """distilbert-base-german-cased""": {"""do_lower_case""": False},
    """distilbert-base-multilingual-cased""": {"""do_lower_case""": False},
}
class 		lowerCamelCase  (      _A       ):
	snake_case_      =   VOCAB_FILES_NAMES
	snake_case_      =   PRETRAINED_VOCAB_FILES_MAP
	snake_case_      =   PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
	snake_case_      =   PRETRAINED_INIT_CONFIGURATION
	snake_case_      =   ["input_ids", "attention_mask"]
	snake_case_      =   DistilBertTokenizer



	def __init__(   self		,      a_=None		,      a_=None		,      a_=True		,      a_="[UNK]"		,      a_="[SEP]"		,      a_="[PAD]"		,      a_="[CLS]"		,      a_="[MASK]"		,      a_=True		,      a_=None		,      **a_		,      ):
			super().__init__(
			    a_		,      tokenizer_file=a_		,      do_lower_case=a_		,      unk_token=a_		,      sep_token=a_		,      pad_token=a_		,      cls_token=a_		,      mask_token=a_		,      tokenize_chinese_chars=a_		,      strip_accents=a_		,      **a_		,      )

			lowerCAmelCase     :    Tuple						=   json.loads(self.backend_tokenizer.normalizer.__getstate__()	)
			if (
			    normalizer_state.get("lowercase"		,      a_	) != do_lower_case
			    or normalizer_state.get("strip_accents"		,      a_	) != strip_accents
			    or normalizer_state.get("handle_chinese_chars"		,      a_	) != tokenize_chinese_chars
			):
					lowerCAmelCase     :    str						=   getattr(a_		,      normalizer_state.pop("type"	)	)
					lowerCAmelCase     :    Optional[int]						=   do_lower_case
					lowerCAmelCase     :    Any						=   strip_accents
					lowerCAmelCase     :    Optional[Any]						=   tokenize_chinese_chars
					lowerCAmelCase     :    Tuple						=   normalizer_class(**a_	)

			lowerCAmelCase     :    Union[str, Any]						=   do_lower_case



	def   _lowerCamelCase    (   self		,      a_		,      a_=None	):
			lowerCAmelCase     :    Tuple						=   [self.cls_token_id] + token_ids_a + [self.sep_token_id]

			if token_ids_a:
					output += token_ids_a + [self.sep_token_id]

			return output



	def   _lowerCamelCase    (   self		,      a_		,      a_ = None	):
			lowerCAmelCase     :    Tuple						=   [self.sep_token_id]
			lowerCAmelCase     :    Any						=   [self.cls_token_id]
			if token_ids_a is None:
					return len(cls + token_ids_a + sep	) * [0]
			return len(cls + token_ids_a + sep	) * [0] + len(token_ids_a + sep	) * [1]





	def   _lowerCamelCase    (   self		,      a_		,      a_ = None	):
			lowerCAmelCase     :    Union[str, Any]						=   self._tokenizer.model.save(a_		,      name=a_	)
			return tuple(a_	)










'''simple docstring'''






import inspect
import unittest

import numpy as np

from tests.test_modeling_common import floats_tensor
from transformers import MaskaFormerConfig, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
from transformers.utils import cached_property

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
					import torch

					from transformers import MaskaFormerForUniversalSegmentation, MaskaFormerModel

					if is_vision_available():
										from transformers import MaskaFormerImageProcessor

if is_vision_available():
					from PIL import Image
class 		lowerCamelCase  :



	def __init__(   self		,      a_		,      a_=2		,      a_=True		,      a_=False		,      a_=10		,      a_=3		,      a_=32 * 8		,      a_=32 * 8		,      a_=4		,      a_=64		,      ):
			lowerCAmelCase     :    Optional[int]						=   parent
			lowerCAmelCase     :    Optional[Any]						=   batch_size
			lowerCAmelCase     :    str						=   is_training
			lowerCAmelCase     :    Any						=   use_auxiliary_loss
			lowerCAmelCase     :    Dict						=   num_queries
			lowerCAmelCase     :    Dict						=   num_channels
			lowerCAmelCase     :    str						=   min_size
			lowerCAmelCase     :    Any						=   max_size
			lowerCAmelCase     :    int						=   num_labels
			lowerCAmelCase     :    Tuple						=   hidden_dim
			lowerCAmelCase     :    Optional[Any]						=   hidden_dim



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    int						=   floats_tensor([self.batch_size, self.num_channels, self.min_size, self.max_size]	).to(
			    a_	)

			lowerCAmelCase     :    Optional[int]						=   torch.ones([self.batch_size, self.min_size, self.max_size]		,      device=a_	)

			lowerCAmelCase     :    str						=   (
			    torch.rand([self.batch_size, self.num_labels, self.min_size, self.max_size]		,      device=a_	) > 0.5
			).float()
			lowerCAmelCase     :    Union[str, Any]						=   (torch.rand((self.batch_size, self.num_labels)		,      device=a_	) > 0.5).long()

			lowerCAmelCase     :    Optional[Any]						=   self.get_config()
			return config, pixel_values, pixel_mask, mask_labels, class_labels



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    Optional[Any]						=   MaskaFormerConfig(
			    hidden_size=self.hidden_dim		,      )
			lowerCAmelCase     :    Optional[Any]						=   self.num_queries
			lowerCAmelCase     :    Optional[Any]						=   self.num_labels

			lowerCAmelCase     :    str						=   [1, 1, 1, 1]
			lowerCAmelCase     :    Tuple						=   self.num_channels

			lowerCAmelCase     :    str						=   64
			lowerCAmelCase     :    Any						=   128
			lowerCAmelCase     :    List[str]						=   self.hidden_dim
			lowerCAmelCase     :    Optional[Any]						=   self.hidden_dim
			lowerCAmelCase     :    int						=   self.hidden_dim
			return config



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase     :    int						=   self.prepare_config_and_inputs()
			lowerCAmelCase     :    Optional[int]						=   {"pixel_values": pixel_values, "pixel_mask": pixel_mask}
			return config, inputs_dict



	def   _lowerCamelCase    (   self		,      a_		,      a_	):
			lowerCAmelCase     :    str						=   output.encoder_hidden_states
			lowerCAmelCase     :    List[str]						=   output.pixel_decoder_hidden_states
			lowerCAmelCase     :    Any						=   output.transformer_decoder_hidden_states

			self.parent.assertTrue(len(a_	)		,      len(config.backbone_config.depths	)	)
			self.parent.assertTrue(len(a_	)		,      len(config.backbone_config.depths	)	)
			self.parent.assertTrue(len(a_	)		,      config.decoder_layers	)



	def   _lowerCamelCase    (   self		,      a_		,      a_		,      a_		,      a_=False	):
			with torch.no_grad():
					lowerCAmelCase     :    Tuple						=   MaskaFormerModel(config=a_	)
					model.to(a_	)
					model.eval()

					lowerCAmelCase     :    Tuple						=   model(pixel_values=a_		,      pixel_mask=a_	)
					lowerCAmelCase     :    str						=   model(a_		,      output_hidden_states=a_	)

			self.parent.assertEqual(
			    output.transformer_decoder_last_hidden_state.shape		,      (self.batch_size, self.num_queries, self.hidden_dim)		,      )
			# let's ensure the other two hidden state exists
			self.parent.assertTrue(output.pixel_decoder_last_hidden_state is not None	)
			self.parent.assertTrue(output.encoder_last_hidden_state is not None	)

			if output_hidden_states:
					self.check_output_hidden_state(a_		,      a_	)





	def   _lowerCamelCase    (   self		,      a_		,      a_		,      a_		,      a_		,      a_	):
			lowerCAmelCase     :    Union[str, Any]						=   MaskaFormerForUniversalSegmentation(config=a_	)
			model.to(a_	)
			model.eval()

			def comm_check_on_output(a_	):
					# let's still check that all the required stuff is there
					self.parent.assertTrue(result.transformer_decoder_last_hidden_state is not None	)
					self.parent.assertTrue(result.pixel_decoder_last_hidden_state is not None	)
					self.parent.assertTrue(result.encoder_last_hidden_state is not None	)
					# okay, now we need to check the logits shape
					# due to the encoder compression, masks have a //4 spatial size
					self.parent.assertEqual(
					    result.masks_queries_logits.shape		,      (self.batch_size, self.num_queries, self.min_size // 4, self.max_size // 4)		,      )
					# + 1 for null class
					self.parent.assertEqual(
					    result.class_queries_logits.shape		,      (self.batch_size, self.num_queries, self.num_labels + 1)	)

			with torch.no_grad():
					lowerCAmelCase     :    List[str]						=   model(pixel_values=a_		,      pixel_mask=a_	)
					lowerCAmelCase     :    Union[str, Any]						=   model(a_	)

					comm_check_on_output(a_	)

					lowerCAmelCase     :    str						=   model(
					    pixel_values=a_		,      pixel_mask=a_		,      mask_labels=a_		,      class_labels=a_	)

			comm_check_on_output(a_	)

			self.parent.assertTrue(result.loss is not None	)
			self.parent.assertEqual(result.loss.shape		,      torch.Size([1]	)	)






@require_torch
class 		lowerCamelCase  (      _A      ,   _A      ,   unittest.TestCase       ):
	snake_case_      =   (MaskaFormerModel, MaskaFormerForUniversalSegmentation) if is_torch_available() else ()
	snake_case_      =   {"feature-extraction": MaskaFormerModel} if is_torch_available() else {}

	snake_case_      =   False
	snake_case_      =   False
	snake_case_      =   False
	snake_case_      =   False



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    List[Any]						=   MaskaFormerModelTester(self	)
			lowerCAmelCase     :    Tuple						=   ConfigTester(self		,      config_class=a_		,      has_text_modality=a_	)



	def   _lowerCamelCase    (   self	):
			self.config_tester.run_common_tests()



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase	,		lowerCAmelCase     :    List[str]						=   self.model_tester.prepare_config_and_inputs_for_common()
			self.model_tester.create_and_check_maskaformer_model(a_		,      **a_		,      output_hidden_states=a_	)



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    List[str]						=   self.model_tester.prepare_config_and_inputs()
			self.model_tester.create_and_check_maskaformer_instance_segmentation_head_model(*a_	)



	@unittest.skip(reason="Mask2Former does not use inputs_embeds"	)
	def   _lowerCamelCase    (   self	):
			pass



	@unittest.skip(reason="Mask2Former does not have a get_input_embeddings method"	)
	def   _lowerCamelCase    (   self	):
			pass



	@unittest.skip(reason="Mask2Former is not a generative model"	)
	def   _lowerCamelCase    (   self	):
			pass



	@unittest.skip(reason="Mask2Former does not use token embeddings"	)
	def   _lowerCamelCase    (   self	):
			pass



	@require_torch_multi_gpu
	@unittest.skip(
	    reason="Mask2Former has some layers using `add_module` which doesn't work well with `nn.DataParallel`"	)
	def   _lowerCamelCase    (   self	):
			pass



	@unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."	)
	def   _lowerCamelCase    (   self	):
			pass



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase	,		lowerCAmelCase     :    Any						=   self.model_tester.prepare_config_and_inputs_for_common()

			for model_class in self.all_model_classes:
					lowerCAmelCase     :    Dict						=   model_class(a_	)
					lowerCAmelCase     :    Optional[Any]						=   inspect.signature(model.forward	)
					# signature.parameters is an OrderedDict => so arg_names order is deterministic
					lowerCAmelCase     :    List[str]						=   [*signature.parameters.keys()]

					lowerCAmelCase     :    Tuple						=   ["pixel_values"]
					self.assertListEqual(arg_names[:1]		,      a_	)



	@slow
	def   _lowerCamelCase    (   self	):
			for model_name in ["facebook/mask2former-swin-small-coco-instance"]:
					lowerCAmelCase     :    int						=   MaskaFormerModel.from_pretrained(a_	)
					self.assertIsNotNone(a_	)



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    List[Any]						=   (self.model_tester.min_size,) * 2
			lowerCAmelCase     :    Union[str, Any]						=   {
			    "pixel_values": torch.randn((2, 3, *size)		,      device=a_	),
			    "mask_labels": torch.randn((2, 10, *size)		,      device=a_	),
			    "class_labels": torch.zeros(2		,      10		,      device=a_	).long(),
			}
			lowerCAmelCase     :    Optional[Any]						=   self.model_tester.get_config()

			lowerCAmelCase     :    List[Any]						=   MaskaFormerForUniversalSegmentation(a_	).to(a_	)
			lowerCAmelCase     :    Dict						=   model(**a_	)
			self.assertTrue(outputs.loss is not None	)



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase	,		lowerCAmelCase     :    int						=   self.model_tester.prepare_config_and_inputs_for_common()
			self.model_tester.create_and_check_maskaformer_model(a_		,      **a_		,      output_hidden_states=a_	)



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase	,		lowerCAmelCase     :    Optional[int]						=   self.model_tester.prepare_config_and_inputs_for_common()

			for model_class in self.all_model_classes:
					lowerCAmelCase     :    Optional[int]						=   model_class(a_	).to(a_	)
					lowerCAmelCase     :    Union[str, Any]						=   model(**a_		,      output_attentions=a_	)
					self.assertTrue(outputs.attentions is not None	)



	def   _lowerCamelCase    (   self	):
			if not self.model_tester.is_training:
					return

			lowerCAmelCase     :    List[Any]						=   self.all_model_classes[1]
			lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase     :    List[str]						=   self.model_tester.prepare_config_and_inputs()

			lowerCAmelCase     :    List[Any]						=   model_class(a_	)
			model.to(a_	)
			model.train()

			lowerCAmelCase     :    Union[str, Any]						=   model(a_		,      mask_labels=a_		,      class_labels=a_	).loss
			loss.backward()





	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    Optional[int]						=   self.all_model_classes[1]
			lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase	,		lowerCAmelCase     :    Any						=   self.model_tester.prepare_config_and_inputs()
			lowerCAmelCase     :    Tuple						=   True
			lowerCAmelCase     :    int						=   True

			lowerCAmelCase     :    int						=   model_class(a_	).to(a_	)
			model.train()

			lowerCAmelCase     :    Any						=   model(a_		,      mask_labels=a_		,      class_labels=a_	)

			lowerCAmelCase     :    List[Any]						=   outputs.encoder_hidden_states[0]
			encoder_hidden_states.retain_grad()

			lowerCAmelCase     :    Optional[int]						=   outputs.pixel_decoder_hidden_states[0]
			pixel_decoder_hidden_states.retain_grad()

			lowerCAmelCase     :    List[Any]						=   outputs.transformer_decoder_hidden_states[0]
			transformer_decoder_hidden_states.retain_grad()

			lowerCAmelCase     :    Tuple						=   outputs.attentions[0]
			attentions.retain_grad()

			outputs.loss.backward(retain_graph=a_	)

			self.assertIsNotNone(encoder_hidden_states.grad	)
			self.assertIsNotNone(pixel_decoder_hidden_states.grad	)
			self.assertIsNotNone(transformer_decoder_hidden_states.grad	)
			self.assertIsNotNone(attentions.grad	)






lowerCAmelCase       		=      1e-4






def      __A						(							):
		lowerCAmelCase     :    str						=   Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"	)
		return image

@require_vision
@slow
class 		lowerCamelCase  (      unittest.TestCase       ):



	@cached_property
	def   _lowerCamelCase    (   self	):
			return "facebook/mask2former-swin-small-coco-instance"



	@cached_property
	def   _lowerCamelCase    (   self	):
			return MaskaFormerImageProcessor.from_pretrained(self.model_checkpoints	) if is_vision_available() else None



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    int						=   MaskaFormerModel.from_pretrained(self.model_checkpoints	).to(a_	)
			lowerCAmelCase     :    Optional[int]						=   self.default_image_processor
			lowerCAmelCase     :    Dict						=   prepare_img()
			lowerCAmelCase     :    Any						=   image_processor(a_		,      return_tensors="pt"	).to(a_	)
			lowerCAmelCase     :    str						=   inputs["pixel_values"].shape
			# check size is divisible by 32
			self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0	)
			# check size
			self.assertEqual(a_		,      (1, 3, 384, 384)	)

			with torch.no_grad():
					lowerCAmelCase     :    Dict						=   model(**a_	)

			lowerCAmelCase     :    Union[str, Any]						=   torch.tensor(
			    [[-0.2790, -1.0717, -1.1668], [-0.5128, -0.3128, -0.4987], [-0.5832, 0.1971, -0.0197]]	).to(a_	)
			self.assertTrue(
			    torch.allclose(
			        outputs.encoder_last_hidden_state[0, 0, :3, :3]		,      a_		,      atol=a_	)	)

			lowerCAmelCase     :    Optional[Any]						=   torch.tensor(
			    [[0.8973, 1.1847, 1.1776], [1.1934, 1.5040, 1.5128], [1.1153, 1.4486, 1.4951]]	).to(a_	)
			self.assertTrue(
			    torch.allclose(
			        outputs.pixel_decoder_last_hidden_state[0, 0, :3, :3]		,      a_		,      atol=a_	)	)

			lowerCAmelCase     :    Optional[int]						=   torch.tensor(
			    [[2.1152, 1.7000, -0.8603], [1.5808, 1.8004, -0.9353], [1.6043, 1.7495, -0.5999]]	).to(a_	)
			self.assertTrue(
			    torch.allclose(
			        outputs.transformer_decoder_last_hidden_state[0, :3, :3]		,      a_		,      atol=a_	)	)



	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    Any						=   MaskaFormerForUniversalSegmentation.from_pretrained(self.model_checkpoints	).to(a_	).eval()
			lowerCAmelCase     :    Union[str, Any]						=   self.default_image_processor
			lowerCAmelCase     :    Dict						=   prepare_img()
			lowerCAmelCase     :    Tuple						=   image_processor(a_		,      return_tensors="pt"	).to(a_	)
			lowerCAmelCase     :    Any						=   inputs["pixel_values"].shape
			# check size is divisible by 32
			self.assertTrue((inputs_shape[-1] % 32) == 0 and (inputs_shape[-2] % 32) == 0	)
			# check size
			self.assertEqual(a_		,      (1, 3, 384, 384)	)

			with torch.no_grad():
					lowerCAmelCase     :    List[str]						=   model(**a_	)
			# masks_queries_logits
			lowerCAmelCase     :    Optional[Any]						=   outputs.masks_queries_logits
			self.assertEqual(
			    masks_queries_logits.shape		,      (1, model.config.num_queries, inputs_shape[-2] // 4, inputs_shape[-1] // 4)	)
			lowerCAmelCase     :    Tuple						=   [
			    [-8.7839, -9.0056, -8.8121],
			    [-7.4104, -7.0313, -6.5401],
			    [-6.6105, -6.3427, -6.4675],
			]
			lowerCAmelCase     :    Tuple						=   torch.tensor(a_	).to(a_	)
			self.assertTrue(torch.allclose(masks_queries_logits[0, 0, :3, :3]		,      a_		,      atol=a_	)	)
			# class_queries_logits
			lowerCAmelCase     :    str						=   outputs.class_queries_logits
			self.assertEqual(class_queries_logits.shape		,      (1, model.config.num_queries, model.config.num_labels + 1)	)
			lowerCAmelCase     :    List[str]						=   torch.tensor(
			    [
			        [1.8324, -8.0835, -4.1922],
			        [0.8450, -9.0050, -3.6053],
			        [0.3045, -7.7293, -3.0275],
			    ]	).to(a_	)
			self.assertTrue(torch.allclose(outputs.class_queries_logits[0, :3, :3]		,      a_		,      atol=a_	)	)





	def   _lowerCamelCase    (   self	):
			lowerCAmelCase     :    Tuple						=   MaskaFormerForUniversalSegmentation.from_pretrained(self.model_checkpoints	).to(a_	).eval()
			lowerCAmelCase     :    Optional[Any]						=   self.default_image_processor

			lowerCAmelCase     :    Optional[int]						=   image_processor(
			    [np.zeros((3, 800, 1_333)	), np.zeros((3, 800, 1_333)	)]		,      segmentation_maps=[np.zeros((384, 384)	).astype(np.floataa	), np.zeros((384, 384)	).astype(np.floataa	)]		,      return_tensors="pt"		,      )

			lowerCAmelCase     :    Optional[int]						=   inputs["pixel_values"].to(a_	)
			lowerCAmelCase     :    int						=   [el.to(a_	) for el in inputs["mask_labels"]]
			lowerCAmelCase     :    Union[str, Any]						=   [el.to(a_	) for el in inputs["class_labels"]]

			with torch.no_grad():
					lowerCAmelCase     :    Optional[Any]						=   model(**a_	)

			self.assertTrue(outputs.loss is not None	)



