

'''simple docstring'''


from __future__ import annotations

import unittest

from transformers import FunnelConfig, is_tf_available
from transformers.testing_utils import require_tf

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
					import tensorflow as tf

					from transformers import (
					    TFFunnelBaseModel,
					    TFFunnelForMaskedLM,
					    TFFunnelForMultipleChoice,
					    TFFunnelForPreTraining,
					    TFFunnelForQuestionAnswering,
					    TFFunnelForSequenceClassification,
					    TFFunnelForTokenClassification,
					    TFFunnelModel,
					)




class     a			:






						"""simple docstring"""




						def __init__(							self					:      Union[str, Any]			,			snake_case_					:      int			,			snake_case_					:      Dict=1_3			,			snake_case_					:      List[str]=7			,			snake_case_					:      List[str]=True			,			snake_case_					:      int=True			,			snake_case_					:      Union[str, Any]=True			,			snake_case_					:      Tuple=True			,			snake_case_					:      int=9_9			,			snake_case_					:      List[str]=[1, 1, 2]			,			snake_case_					:      int=1			,			snake_case_					:      List[str]=3_2			,			snake_case_					:      Dict=4			,			snake_case_					:      int=8			,			snake_case_					:      Tuple=3_7			,			snake_case_					:      int="gelu_new"			,			snake_case_					:      Optional[int]=0.1			,			snake_case_					:      List[str]=0.1			,			snake_case_					:      str=0.0			,			snake_case_					:      Optional[int]=5_1_2			,			snake_case_					:      Union[str, Any]=3			,			snake_case_					:      int=0.0_2			,			snake_case_					:      List[Any]=3			,			snake_case_					:      Union[str, Any]=4			,			snake_case_					:      Union[str, Any]=None			,			snake_case_					:      Dict=False			,			):



								'''simple docstring'''



								snake_case__						:       Optional[int]       						=  parent
								snake_case__						:       Union[str, Any]       						=  batch_size
								snake_case__						:       Any       						=  seq_length
								snake_case__						:       int       						=  is_training
								snake_case__						:       int       						=  use_input_mask
								snake_case__						:       Dict       						=  use_token_type_ids
								snake_case__						:       List[str]       						=  use_labels
								snake_case__						:       List[Any]       						=  vocab_size
								snake_case__						:       Tuple       						=  block_sizes
								snake_case__						:       Optional[int]       						=  num_decoder_layers
								snake_case__						:       Union[str, Any]       						=  d_model
								snake_case__						:       Optional[int]       						=  n_head
								snake_case__						:       List[Any]       						=  d_head
								snake_case__						:       List[Any]       						=  d_inner
								snake_case__						:       List[str]       						=  hidden_act
								snake_case__						:       List[Any]       						=  hidden_dropout
								snake_case__						:       int       						=  attention_dropout
								snake_case__						:       Any       						=  activation_dropout
								snake_case__						:       List[str]       						=  max_position_embeddings
								snake_case__						:       Optional[int]       						=  type_vocab_size
								snake_case__						:       str       						=  2
								snake_case__						:       List[Any]       						=  num_labels
								snake_case__						:       Union[str, Any]       						=  num_choices
								snake_case__						:       List[Any]       						=  scope
								snake_case__						:       List[str]       						=  initializer_std

								# Used in the tests to check the size of the first attention layer
								snake_case__						:       int       						=  n_head
								# Used in the tests to check the size of the first hidden state
								snake_case__						:       Dict       						=  self.d_model
								# Used in the tests to check the number of output hidden states/attentions
								snake_case__						:       List[str]       						=  sum(self.block_sizes  ) + (0 if base else self.num_decoder_layers)
								# FunnelModel adds two hidden layers: input embeddings and the sum of the upsampled encoder hidden state with
								# the last hidden state of the first block (which is the first hidden state of the decoder).
								if not base:
										snake_case__						:       Tuple       						=  self.num_hidden_layers + 2







						def       __magic_name__							(							self					:      Dict  ):



								'''simple docstring'''



								snake_case__						:       Optional[Any]       						=  ids_tensor([self.batch_size, self.seq_length]			,			self.vocab_size  )

								snake_case__						:       List[Any]       						=  None
								if self.use_input_mask:
										snake_case__						:       Optional[int]       						=  random_attention_mask([self.batch_size, self.seq_length]  )

								snake_case__						:       int       						=  None
								if self.use_token_type_ids:
										snake_case__						:       Optional[Any]       						=  ids_tensor([self.batch_size, self.seq_length]			,			self.type_vocab_size  )

								snake_case__						:       Tuple       						=  None
								snake_case__						:       str       						=  None
								snake_case__						:       Union[str, Any]       						=  None
								if self.use_labels:
										snake_case__						:       Optional[int]       						=  ids_tensor([self.batch_size]			,			self.type_sequence_label_size  )
										snake_case__						:       Optional[int]       						=  ids_tensor([self.batch_size, self.seq_length]			,			self.num_labels  )
										snake_case__						:       Tuple       						=  ids_tensor([self.batch_size]			,			self.num_choices  )

								snake_case__						:       List[Any]       						=  FunnelConfig(
								    vocab_size=self.vocab_size			,			block_sizes=self.block_sizes			,			num_decoder_layers=self.num_decoder_layers			,			d_model=self.d_model			,			n_head=self.n_head			,			d_head=self.d_head			,			d_inner=self.d_inner			,			hidden_act=self.hidden_act			,			hidden_dropout=self.hidden_dropout			,			attention_dropout=self.attention_dropout			,			activation_dropout=self.activation_dropout			,			max_position_embeddings=self.max_position_embeddings			,			type_vocab_size=self.type_vocab_size			,			initializer_std=self.initializer_std			,			)

								return (
								    config,
								    input_ids,
								    token_type_ids,
								    input_mask,
								    sequence_labels,
								    token_labels,
								    choice_labels,
								)







						def       __magic_name__							(							self					:      int			,			snake_case_					:      List[Any]			,			snake_case_					:      Optional[int]			,			snake_case_					:      int			,			snake_case_					:      Dict			,			snake_case_					:      Dict			,			snake_case_					:      Tuple			,			snake_case_					:      List[Any]			,			):



								'''simple docstring'''



								snake_case__						:       Any       						=  TFFunnelModel(config=snake_case_  )
								snake_case__						:       Union[str, Any]       						=  {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
								snake_case__						:       str       						=  model(snake_case_  )

								snake_case__						:       List[str]       						=  [input_ids, input_mask]
								snake_case__						:       Any       						=  model(snake_case_  )

								snake_case__						:       List[str]       						=  model(snake_case_  )
								self.parent.assertEqual(result.last_hidden_state.shape			,			(self.batch_size, self.seq_length, self.d_model)  )

								snake_case__						:       Dict       						=  False
								snake_case__						:       Union[str, Any]       						=  TFFunnelModel(config=snake_case_  )
								snake_case__						:       Any       						=  model(snake_case_  )
								self.parent.assertEqual(result.last_hidden_state.shape			,			(self.batch_size, self.seq_length, self.d_model)  )

								snake_case__						:       List[str]       						=  False
								snake_case__						:       List[str]       						=  TFFunnelModel(config=snake_case_  )
								snake_case__						:       str       						=  model(snake_case_  )
								self.parent.assertEqual(result.last_hidden_state.shape			,			(self.batch_size, self.seq_length, self.d_model)  )







						def       __magic_name__							(							self					:      Union[str, Any]			,			snake_case_					:      Optional[int]			,			snake_case_					:      int			,			snake_case_					:      Union[str, Any]			,			snake_case_					:      Dict			,			snake_case_					:      Any			,			snake_case_					:      str			,			snake_case_					:      Union[str, Any]			,			):



								'''simple docstring'''



								snake_case__						:       Union[str, Any]       						=  TFFunnelBaseModel(config=snake_case_  )
								snake_case__						:       Any       						=  {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
								snake_case__						:       List[str]       						=  model(snake_case_  )

								snake_case__						:       str       						=  [input_ids, input_mask]
								snake_case__						:       Any       						=  model(snake_case_  )

								snake_case__						:       Union[str, Any]       						=  model(snake_case_  )
								self.parent.assertEqual(result.last_hidden_state.shape			,			(self.batch_size, 2, self.d_model)  )

								snake_case__						:       List[Any]       						=  False
								snake_case__						:       Union[str, Any]       						=  TFFunnelBaseModel(config=snake_case_  )
								snake_case__						:       int       						=  model(snake_case_  )
								self.parent.assertEqual(result.last_hidden_state.shape			,			(self.batch_size, 3, self.d_model)  )

								snake_case__						:       str       						=  False
								snake_case__						:       int       						=  TFFunnelBaseModel(config=snake_case_  )
								snake_case__						:       str       						=  model(snake_case_  )
								self.parent.assertEqual(result.last_hidden_state.shape			,			(self.batch_size, 2, self.d_model)  )







						def       __magic_name__							(							self					:      List[str]			,			snake_case_					:      Optional[int]			,			snake_case_					:      int			,			snake_case_					:      Optional[int]			,			snake_case_					:      List[str]			,			snake_case_					:      int			,			snake_case_					:      List[Any]			,			snake_case_					:      Optional[Any]			,			):



								'''simple docstring'''



								snake_case__						:       Union[str, Any]       						=  TFFunnelForPreTraining(config=snake_case_  )
								snake_case__						:       int       						=  {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
								snake_case__						:       str       						=  model(snake_case_  )
								self.parent.assertEqual(result.logits.shape			,			(self.batch_size, self.seq_length)  )







						def       __magic_name__							(							self					:      Tuple			,			snake_case_					:      int			,			snake_case_					:      Any			,			snake_case_					:      Union[str, Any]			,			snake_case_					:      Any			,			snake_case_					:      Tuple			,			snake_case_					:      Tuple			,			snake_case_					:      List[Any]			,			):



								'''simple docstring'''



								snake_case__						:       Any       						=  TFFunnelForMaskedLM(config=snake_case_  )
								snake_case__						:       List[Any]       						=  {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
								snake_case__						:       Any       						=  model(snake_case_  )
								self.parent.assertEqual(result.logits.shape			,			(self.batch_size, self.seq_length, self.vocab_size)  )







						def       __magic_name__							(							self					:      Tuple			,			snake_case_					:      Optional[int]			,			snake_case_					:      Optional[Any]			,			snake_case_					:      Optional[int]			,			snake_case_					:      Optional[Any]			,			snake_case_					:      Optional[int]			,			snake_case_					:      str			,			snake_case_					:      Optional[int]			,			):



								'''simple docstring'''



								snake_case__						:       Optional[int]       						=  self.num_labels
								snake_case__						:       Tuple       						=  TFFunnelForSequenceClassification(config=snake_case_  )
								snake_case__						:       Union[str, Any]       						=  {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
								snake_case__						:       Dict       						=  model(snake_case_  )
								self.parent.assertEqual(result.logits.shape			,			(self.batch_size, self.num_labels)  )







						def       __magic_name__							(							self					:      Optional[int]			,			snake_case_					:      Optional[int]			,			snake_case_					:      Any			,			snake_case_					:      Any			,			snake_case_					:      str			,			snake_case_					:      Dict			,			snake_case_					:      int			,			snake_case_					:      str			,			):



								'''simple docstring'''



								snake_case__						:       Any       						=  self.num_choices
								snake_case__						:       List[Any]       						=  TFFunnelForMultipleChoice(config=snake_case_  )
								snake_case__						:       Dict       						=  tf.tile(tf.expand_dims(snake_case_			,			1  )			,			(1, self.num_choices, 1)  )
								snake_case__						:       Any       						=  tf.tile(tf.expand_dims(snake_case_			,			1  )			,			(1, self.num_choices, 1)  )
								snake_case__						:       str       						=  tf.tile(tf.expand_dims(snake_case_			,			1  )			,			(1, self.num_choices, 1)  )
								snake_case__						:       List[str]       						=  {
								    '''input_ids''': multiple_choice_inputs_ids,
								    '''attention_mask''': multiple_choice_input_mask,
								    '''token_type_ids''': multiple_choice_token_type_ids,
								}
								snake_case__						:       Union[str, Any]       						=  model(snake_case_  )
								self.parent.assertEqual(result.logits.shape			,			(self.batch_size, self.num_choices)  )







						def       __magic_name__							(							self					:      Tuple			,			snake_case_					:      List[str]			,			snake_case_					:      List[Any]			,			snake_case_					:      str			,			snake_case_					:      Optional[Any]			,			snake_case_					:      Union[str, Any]			,			snake_case_					:      str			,			snake_case_					:      Optional[Any]			,			):



								'''simple docstring'''



								snake_case__						:       Optional[Any]       						=  self.num_labels
								snake_case__						:       Optional[Any]       						=  TFFunnelForTokenClassification(config=snake_case_  )
								snake_case__						:       Union[str, Any]       						=  {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
								snake_case__						:       Dict       						=  model(snake_case_  )
								self.parent.assertEqual(result.logits.shape			,			(self.batch_size, self.seq_length, self.num_labels)  )







						def       __magic_name__							(							self					:      str			,			snake_case_					:      Optional[Any]			,			snake_case_					:      Optional[int]			,			snake_case_					:      Dict			,			snake_case_					:      Optional[int]			,			snake_case_					:      Optional[Any]			,			snake_case_					:      Optional[Any]			,			snake_case_					:      Any			,			):



								'''simple docstring'''



								snake_case__						:       Optional[Any]       						=  TFFunnelForQuestionAnswering(config=snake_case_  )
								snake_case__						:       Tuple       						=  {'''input_ids''': input_ids, '''attention_mask''': input_mask, '''token_type_ids''': token_type_ids}
								snake_case__						:       Any       						=  model(snake_case_  )
								self.parent.assertEqual(result.start_logits.shape			,			(self.batch_size, self.seq_length)  )
								self.parent.assertEqual(result.end_logits.shape			,			(self.batch_size, self.seq_length)  )







						def       __magic_name__							(							self					:      int  ):



								'''simple docstring'''



								snake_case__						:       Optional[int]       						=  self.prepare_config_and_inputs()
								(
								    (
								    snake_case__
								)						,       (
								    snake_case__
								)						,       (
								    snake_case__
								)						,       (
								    snake_case__
								)						,       (
								    snake_case__
								)						,       (
								    snake_case__
								)						,       (
								    snake_case__
								)						,       
								)						:       Any       						=  config_and_inputs
								snake_case__						:       List[Any]       						=  {'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
								return config, inputs_dict





@require_tf
class     a			(				SCREAMING_SNAKE_CASE			,			SCREAMING_SNAKE_CASE			,			unittest.TestCase       ):






						"""simple docstring"""




						__UpperCAmelCase			     =    (
						    (
						        TFFunnelModel,
						        TFFunnelForMaskedLM,
						        TFFunnelForPreTraining,
						        TFFunnelForQuestionAnswering,
						        TFFunnelForTokenClassification,
						    )
						    if is_tf_available()
						    else ()
						)
						__UpperCAmelCase			     =    (
						    {
						        """feature-extraction""": (TFFunnelBaseModel, TFFunnelModel),
						        """fill-mask""": TFFunnelForMaskedLM,
						        """question-answering""": TFFunnelForQuestionAnswering,
						        """text-classification""": TFFunnelForSequenceClassification,
						        """token-classification""": TFFunnelForTokenClassification,
						        """zero-shot""": TFFunnelForSequenceClassification,
						    }
						    if is_tf_available()
						    else {}
						)
						__UpperCAmelCase			     =    False
						__UpperCAmelCase			     =    False







						def       __magic_name__							(							self					:      Optional[int]  ):



								'''simple docstring'''



								snake_case__						:       Dict       						=  TFFunnelModelTester(self  )
								snake_case__						:       Tuple       						=  ConfigTester(self			,			config_class=snake_case_  )







						def       __magic_name__							(							self					:      Optional[Any]  ):



								'''simple docstring'''



								self.config_tester.run_common_tests()







						def       __magic_name__							(							self					:      str  ):



								'''simple docstring'''



								snake_case__						:       Dict       						=  self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*snake_case_  )







						def       __magic_name__							(							self					:      Tuple  ):



								'''simple docstring'''



								snake_case__						:       Tuple       						=  self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_pretraining(*snake_case_  )







						def       __magic_name__							(							self					:      Optional[Any]  ):



								'''simple docstring'''



								snake_case__						:       Tuple       						=  self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_masked_lm(*snake_case_  )







						def       __magic_name__							(							self					:      Any  ):



								'''simple docstring'''



								snake_case__						:       Optional[Any]       						=  self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_token_classification(*snake_case_  )







						def       __magic_name__							(							self					:      Tuple  ):



								'''simple docstring'''



								snake_case__						:       Optional[Any]       						=  self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_question_answering(*snake_case_  )





@require_tf
class     a			(				SCREAMING_SNAKE_CASE			,			unittest.TestCase       ):






						"""simple docstring"""




						__UpperCAmelCase			     =    (
						    (TFFunnelBaseModel, TFFunnelForMultipleChoice, TFFunnelForSequenceClassification) if is_tf_available() else ()
						)
						__UpperCAmelCase			     =    False
						__UpperCAmelCase			     =    False







						def       __magic_name__							(							self					:      int  ):



								'''simple docstring'''



								snake_case__						:       int       						=  TFFunnelModelTester(self			,			base=snake_case_  )
								snake_case__						:       Optional[Any]       						=  ConfigTester(self			,			config_class=snake_case_  )







						def       __magic_name__							(							self					:      int  ):



								'''simple docstring'''



								self.config_tester.run_common_tests()







						def       __magic_name__							(							self					:      List[str]  ):



								'''simple docstring'''



								snake_case__						:       List[str]       						=  self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_base_model(*snake_case_  )







						def       __magic_name__							(							self					:      List[Any]  ):



								'''simple docstring'''



								snake_case__						:       Any       						=  self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_sequence_classification(*snake_case_  )







						def       __magic_name__							(							self					:      Tuple  ):



								'''simple docstring'''



								snake_case__						:       Dict       						=  self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_multiple_choice(*snake_case_  )






'''simple docstring'''


from typing import Tuple, Union

from ...modeling_outputs import BackboneOutput
from ...modeling_utils import PreTrainedModel
from ...utils import is_timm_available, is_torch_available, requires_backends
from ...utils.backbone_utils import BackboneMixin
from .configuration_timm_backbone import TimmBackboneConfig


if is_timm_available():
					import timm


if is_torch_available():
					from torch import Tensor




class     a			(				SCREAMING_SNAKE_CASE			,			SCREAMING_SNAKE_CASE       ):






						"""simple docstring"""




						__UpperCAmelCase			     =    """pixel_values"""
						__UpperCAmelCase			     =    False
						__UpperCAmelCase			     =    TimmBackboneConfig







						def __init__(							self					:      str			,			snake_case_					:      str			,			**snake_case_					:      Dict  ):



								'''simple docstring'''



								requires_backends(self			,			'''timm'''  )
								super().__init__(snake_case_  )
								snake_case__						:       List[str]       						=  config

								if config.backbone is None:
										raise ValueError('''backbone is not set in the config. Please set it to a timm model name.'''  )

								if config.backbone not in timm.list_models():
										raise ValueError(F"""backbone {config.backbone} is not supported by timm."""  )

								if hasattr(snake_case_			,			'''out_features'''  ) and config.out_features is not None:
										raise ValueError('''out_features is not supported by TimmBackbone. Please use out_indices instead.'''  )

								snake_case__						:       Dict       						=  getattr(snake_case_			,			'''use_pretrained_backbone'''			,			snake_case_  )
								if pretrained is None:
										raise ValueError('''use_pretrained_backbone is not set in the config. Please set it to True or False.'''  )

								# We just take the final layer by default. This matches the default for the transformers models.
								snake_case__						:       int       						=  config.out_indices if getattr(snake_case_			,			'''out_indices'''			,			snake_case_  ) is not None else (-1,)

								snake_case__						:       Any       						=  timm.create_model(
								    config.backbone			,			pretrained=snake_case_			,			features_only=config.features_only			,			in_chans=config.num_channels			,			out_indices=snake_case_			,			**snake_case_			,			)
								# These are used to control the output of the model when called. If output_hidden_states is True, then
								# return_layers is modified to include all layers.
								snake_case__						:       str       						=  self._backbone.return_layers
								snake_case__						:       List[Any]       						=  {layer['''module''']: str(snake_case_  ) for i, layer in enumerate(self._backbone.feature_info.info  )}
								super()._init_backbone(snake_case_  )







						@classmethod
						def       __magic_name__							(							cls					:      Union[str, Any]			,			snake_case_					:      Union[str, Any]			,			*snake_case_					:      Optional[Any]			,			**snake_case_					:      Optional[Any]  ):



								'''simple docstring'''



								requires_backends(cls			,			['''vision''', '''timm''']  )
								from ...models.timm_backbone import TimmBackboneConfig

								snake_case__						:       Dict       						=  kwargs.pop('''config'''			,			TimmBackboneConfig()  )

								snake_case__						:       Optional[Any]       						=  kwargs.pop('''use_timm_backbone'''			,			snake_case_  )
								if not use_timm:
										raise ValueError('''use_timm_backbone must be True for timm backbones'''  )

								snake_case__						:       List[Any]       						=  kwargs.pop('''num_channels'''			,			config.num_channels  )
								snake_case__						:       Optional[Any]       						=  kwargs.pop('''features_only'''			,			config.features_only  )
								snake_case__						:       Tuple       						=  kwargs.pop('''use_pretrained_backbone'''			,			config.use_pretrained_backbone  )
								snake_case__						:       Union[str, Any]       						=  kwargs.pop('''out_indices'''			,			config.out_indices  )
								snake_case__						:       int       						=  TimmBackboneConfig(
								    backbone=snake_case_			,			num_channels=snake_case_			,			features_only=snake_case_			,			use_pretrained_backbone=snake_case_			,			out_indices=snake_case_			,			)
								return super()._from_config(snake_case_			,			**snake_case_  )







						def       __magic_name__							(							self					:      List[str]			,			snake_case_					:      Union[str, Any]  ):



								'''simple docstring'''



								pass







						def       __magic_name__							(							self					:      Optional[int]			,			snake_case_					:      Union[str, Any]			,			snake_case_					:      Tuple=None			,			snake_case_					:      Tuple=None			,			snake_case_					:      Optional[Any]=None			,			**snake_case_					:      List[str]  ):



								'''simple docstring'''



								snake_case__						:       List[Any]       						=  return_dict if return_dict is not None else self.config.use_return_dict
								snake_case__						:       Optional[int]       						=  (
								    output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
								)
								snake_case__						:       int       						=  output_attentions if output_attentions is not None else self.config.output_attentions

								if output_attentions:
										raise ValueError('''Cannot output attentions for timm backbones at the moment'''  )

								if output_hidden_states:
										# We modify the return layers to include all the stages of the backbone
										snake_case__						:       Any       						=  self._all_layers
										snake_case__						:       str       						=  self._backbone(snake_case_			,			**snake_case_  )
										snake_case__						:       Tuple       						=  self._return_layers
										snake_case__						:       str       						=  tuple(hidden_states[i] for i in self.out_indices  )
								else:
										snake_case__						:       Dict       						=  self._backbone(snake_case_			,			**snake_case_  )
										snake_case__						:       Any       						=  None

								snake_case__						:       Union[str, Any]       						=  tuple(snake_case_  )
								snake_case__						:       Optional[int]       						=  tuple(snake_case_  ) if hidden_states is not None else None

								if not return_dict:
										snake_case__						:       List[str]       						=  (feature_maps,)
										if output_hidden_states:
												snake_case__						:       Optional[int]       						=  output + (hidden_states,)
										return output

								return BackboneOutput(feature_maps=snake_case_			,			hidden_states=snake_case_			,			attentions=snake_case_  )



