




from typing import Dict, Tuple, overload

import torch
import torch.types
from torch import nn

from . import residue_constants as rc
from .rigid_utils import Rigid, Rotation
from .tensor_utils import batched_gather





@overload
def 							A__   (snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor		,  snake_case      :		None							)    ->	torch.Tensor:
					...





@overload
def 							A__   (snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor							)    ->	Tuple[torch.Tensor, torch.Tensor]:
					...





def 							A__   (snake_case      :		str		,  snake_case      :		int		,  snake_case      :		Optional[Any]							)    ->	str:
					__UpperCamelCase				:  Optional[Any]								=			aatype == rc.restype_order["""G"""]
					__UpperCamelCase				:  int								=			rc.atom_order["""CA"""]
					__UpperCamelCase				:  Dict								=			rc.atom_order["""CB"""]
					__UpperCamelCase				:  int								=			torch.where(
					    is_gly[..., None].expand(*((-1,) * len(is_gly.shape							))		,  3							)		,  all_atom_positions[..., ca_idx, :]		,  all_atom_positions[..., cb_idx, :]		,  )

					if all_atom_masks is not None:
										__UpperCamelCase				:  Any								=			torch.where(
										    snake_case		,  all_atom_masks[..., ca_idx]		,  all_atom_masks[..., cb_idx]		,  )
										return pseudo_beta, pseudo_beta_mask
					else:
										return pseudo_beta





def 							A__   (snake_case      :		torch.Tensor		,  snake_case      :		Dict[str, torch.Tensor]							)    ->	torch.Tensor:
					__UpperCamelCase				:  Tuple								=			batched_gather(
					    snake_case		,  batch["""residx_atom37_to_atom14"""]		,  dim=-2		,  no_batch_dims=len(atomaa.shape[:-2]							)		,  )

					__UpperCamelCase				:  List[Any]								=			atomaa_data * batch["""atom37_atom_exists"""][..., None]

					return atomaa_data





def 							A__   (snake_case      :		Dict[str, torch.Tensor]							)    ->	torch.Tensor:
					__UpperCamelCase				:  str								=			template_feats["""template_aatype"""]
					__UpperCamelCase				:  Optional[int]								=			template_feats["""template_torsion_angles_sin_cos"""]
					__UpperCamelCase				:  Any								=			template_feats["""template_alt_torsion_angles_sin_cos"""]
					__UpperCamelCase				:  Tuple								=			template_feats["""template_torsion_angles_mask"""]
					__UpperCamelCase				:  Dict								=			torch.cat(
					    [
					        nn.functional.one_hot(snake_case		,  22							),
					        torsion_angles_sin_cos.reshape(*torsion_angles_sin_cos.shape[:-2]		,  14							),
					        alt_torsion_angles_sin_cos.reshape(*alt_torsion_angles_sin_cos.shape[:-2]		,  14							),
					        torsion_angles_mask,
					    ]		,  dim=-1		,  )

					return template_angle_feat





def 							A__   (snake_case      :		Dict[str, torch.Tensor]		,  snake_case      :		torch.types.Number		,  snake_case      :		torch.types.Number		,  snake_case      :		int		,  snake_case      :		bool = False		,  snake_case      :		float = 1e-20		,  snake_case      :		float = 1e8		,  )    ->	torch.Tensor:
					__UpperCamelCase				:  Tuple								=			batch["""template_pseudo_beta_mask"""]
					__UpperCamelCase				:  Optional[int]								=			template_mask[..., None] * template_mask[..., None, :]

					# Compute distogram (this seems to differ slightly from Alg. 5)
					__UpperCamelCase				:  Any								=			batch["""template_pseudo_beta"""]
					__UpperCamelCase				:  Optional[int]								=			torch.sum((tpb[..., None, :] - tpb[..., None, :, :]) ** 2		,  dim=-1		,  keepdim=snake_case							)
					__UpperCamelCase				:  Optional[int]								=			torch.linspace(snake_case		,  snake_case		,  snake_case		,  device=tpb.device							) ** 2
					__UpperCamelCase				:  Any								=			torch.cat([lower[1:], lower.new_tensor([inf]							)]		,  dim=-1							)
					__UpperCamelCase				:  int								=			((dgram > lower) * (dgram < upper)).type(dgram.dtype							)

					__UpperCamelCase				:  str								=			[dgram, template_mask_ad[..., None]]

					__UpperCamelCase				:  torch.LongTensor								=			nn.functional.one_hot(
					    batch["""template_aatype"""]		,  rc.restype_num + 2		,  )

					__UpperCamelCase				:  List[Any]								=			batch["""template_aatype"""].shape[-1]
					to_concat.append(aatype_one_hot[..., None, :, :].expand(*aatype_one_hot.shape[:-2]		,  snake_case		,  -1		,  -1							)							)
					to_concat.append(aatype_one_hot[..., None, :].expand(*aatype_one_hot.shape[:-2]		,  -1		,  snake_case		,  -1							)							)

					__UpperCamelCase			, __UpperCamelCase			, __UpperCamelCase				:  List[Any]								=			[rc.atom_order[a] for a in ["""N""", """CA""", """C"""]]
					__UpperCamelCase				:  int								=			Rigid.make_transform_from_reference(
					    n_xyz=batch["""template_all_atom_positions"""][..., n, :]		,  ca_xyz=batch["""template_all_atom_positions"""][..., ca, :]		,  c_xyz=batch["""template_all_atom_positions"""][..., c, :]		,  eps=snake_case		,  )
					__UpperCamelCase				:  int								=			rigids.get_trans()[..., None, :, :]
					__UpperCamelCase				:  int								=			rigids[..., None].invert_apply(snake_case							)

					__UpperCamelCase				:  List[str]								=			torch.rsqrt(eps + torch.sum(rigid_vec**2		,  dim=-1							)							)

					__UpperCamelCase				:  Union[str, Any]								=			batch["""template_all_atom_mask"""]
					__UpperCamelCase				:  int								=			t_aa_masks[..., n] * t_aa_masks[..., ca] * t_aa_masks[..., c]
					__UpperCamelCase				:  List[Any]								=			template_mask[..., None] * template_mask[..., None, :]

					__UpperCamelCase				:  Optional[Any]								=			inv_distance_scalar * template_mask_ad
					__UpperCamelCase				:  List[Any]								=			rigid_vec * inv_distance_scalar[..., None]

					if not use_unit_vector:
										__UpperCamelCase				:  List[str]								=			unit_vector * 0.0

					to_concat.extend(torch.unbind(unit_vector[..., None, :]		,  dim=-1							)							)
					to_concat.append(template_mask_ad[..., None]							)

					__UpperCamelCase				:  int								=			torch.cat(snake_case		,  dim=-1							)
					__UpperCamelCase				:  Union[str, Any]								=			act * template_mask_ad[..., None]

					return act





def 							A__   (snake_case      :		Dict[str, torch.Tensor]							)    ->	torch.Tensor:
					__UpperCamelCase				:  torch.LongTensor								=			nn.functional.one_hot(batch["""extra_msa"""]		,  23							)
					__UpperCamelCase				:  Union[str, Any]								=			[
					    msa_ahot,
					    batch["""extra_has_deletion"""].unsqueeze(-1							),
					    batch["""extra_deletion_value"""].unsqueeze(-1							),
					]
					return torch.cat(snake_case		,  dim=-1							)





def 							A__   (snake_case      :		Rigid		,  snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor		,  )    ->	Rigid:
					# [*, N, 8, 4, 4]
					__UpperCamelCase				:  Optional[Any]								=			rrgdf[aatype, ...]

					# [*, N, 8] transformations, i.e.
					#   One [*, N, 8, 3, 3] rotation matrix and
					#   One [*, N, 8, 3]    translation matrix
					__UpperCamelCase				:  List[Any]								=			r.from_tensor_axa(snake_case							)

					__UpperCamelCase				:  str								=			alpha.new_zeros((*((1,) * len(alpha.shape[:-1]							)), 2)							)
					__UpperCamelCase				:  Any								=			1

					# [*, N, 8, 2]
					__UpperCamelCase				:  Optional[int]								=			torch.cat([bb_rot.expand(*alpha.shape[:-2]		,  -1		,  -1							), alpha]		,  dim=-2							)

					# [*, N, 8, 3, 3]
					# Produces rotation matrices of the form:
					# [
					#   [1, 0  , 0  ],
					#   [0, a_2,-a_1],
					#   [0, a_1, a_2]
					# ]
					# This follows the original code rather than the supplement, which uses
					# different indices.

					__UpperCamelCase				:  Optional[int]								=			alpha.new_zeros(default_r.get_rots().get_rot_mats().shape							)
					__UpperCamelCase				:  Any								=			1
					__UpperCamelCase				:  int								=			alpha[..., 1]
					__UpperCamelCase				:  int								=			-alpha[..., 0]
					__UpperCamelCase				:  List[str]								=			alpha

					__UpperCamelCase				:  Optional[int]								=			default_r.compose(Rigid(Rotation(rot_mats=snake_case							)		,  snake_case							)							)

					__UpperCamelCase				:  Any								=			all_frames[..., 5]
					__UpperCamelCase				:  Optional[int]								=			all_frames[..., 6]
					__UpperCamelCase				:  Dict								=			all_frames[..., 7]

					__UpperCamelCase				:  Tuple								=			all_frames[..., 4]
					__UpperCamelCase				:  Union[str, Any]								=			chia_frame_to_bb.compose(snake_case							)
					__UpperCamelCase				:  Union[str, Any]								=			chia_frame_to_bb.compose(snake_case							)
					__UpperCamelCase				:  int								=			chia_frame_to_bb.compose(snake_case							)

					__UpperCamelCase				:  Optional[Any]								=			Rigid.cat(
					    [
					        all_frames[..., :5],
					        chia_frame_to_bb.unsqueeze(-1							),
					        chia_frame_to_bb.unsqueeze(-1							),
					        chia_frame_to_bb.unsqueeze(-1							),
					    ]		,  dim=-1		,  )

					__UpperCamelCase				:  str								=			r[..., None].compose(snake_case							)

					return all_frames_to_global







def 							A__   (snake_case      :		Rigid		,  snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor		,  snake_case      :		torch.Tensor		,  )    ->	torch.Tensor:
					# [*, N, 14]
					__UpperCamelCase				:  Tuple								=			group_idx[aatype, ...]

					# [*, N, 14, 8]
					__UpperCamelCase				:  torch.LongTensor								=			nn.functional.one_hot(
					    snake_case		,  num_classes=default_frames.shape[-3]		,  )

					# [*, N, 14, 8]
					__UpperCamelCase				:  List[str]								=			r[..., None, :] * group_mask_one_hot

					# [*, N, 14]
					__UpperCamelCase				:  Optional[int]								=			t_atoms_to_global.map_tensor_fn(lambda snake_case							: torch.sum(snake_case		,  dim=-1							)							)

					# [*, N, 14, 1]
					__UpperCamelCase				:  Optional[Any]								=			atom_mask[aatype, ...].unsqueeze(-1							)

					# [*, N, 14, 3]
					__UpperCamelCase				:  List[str]								=			lit_positions[aatype, ...]
					__UpperCamelCase				:  Optional[int]								=			t_atoms_to_global.apply(snake_case							)
					__UpperCamelCase				:  Union[str, Any]								=			pred_positions * atom_mask

					return pred_positions












import inspect
import unittest

from transformers import EfficientNetConfig
from transformers.testing_utils import is_pipeline_test, require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
	import torch

	from transformers import EfficientNetForImageClassification, EfficientNetModel
	from transformers.models.efficientnet.modeling_efficientnet import EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
	from PIL import Image

	from transformers import AutoImageProcessor


class       SCREAMING_SNAKE_CASE_							:



	"""simple docstring"""


	def __init__(				self		:	Optional[int]				,    lowerCAmelCase		:	List[Any]				,    lowerCAmelCase		:	int=13				,    lowerCAmelCase		:	Union[str, Any]=32				,    lowerCAmelCase		:	List[Any]=3				,    lowerCAmelCase		:	Tuple=[3, 3, 5]				,    lowerCAmelCase		:	str=[32, 16, 24]				,    lowerCAmelCase		:	Dict=[16, 24, 40]				,    lowerCAmelCase		:	Optional[Any]=[1, 1, 2]				,    lowerCAmelCase		:	int=[1, 1, 2]				,    lowerCAmelCase		:	Any=[1, 6, 6]				,    lowerCAmelCase		:	str=True				,    lowerCAmelCase		:	Tuple=True				,    lowerCAmelCase		:	Dict=37				,    lowerCAmelCase		:	Any="gelu"				,    lowerCAmelCase		:	List[str]=10				,    )  ->					Optional[Any]:







						"""simple docstring"""







						__UpperCamelCase				:  List[Any]								=			parent
						__UpperCamelCase				:  Any								=			batch_size
						__UpperCamelCase				:  List[str]								=			image_size
						__UpperCamelCase				:  int								=			num_channels
						__UpperCamelCase				:  Tuple								=			kernel_sizes
						__UpperCamelCase				:  Union[str, Any]								=			in_channels
						__UpperCamelCase				:  int								=			out_channels
						__UpperCamelCase				:  List[str]								=			strides
						__UpperCamelCase				:  Optional[Any]								=			num_block_repeats
						__UpperCamelCase				:  Tuple								=			expand_ratios
						__UpperCamelCase				:  Optional[int]								=			is_training
						__UpperCamelCase				:  Dict								=			hidden_act
						__UpperCamelCase				:  Optional[int]								=			num_labels
						__UpperCamelCase				:  List[Any]								=			use_labels






	def 				lowerCamelCase__    (				self		:	Optional[Any]  )  ->					Tuple:







						"""simple docstring"""







						__UpperCamelCase				:  Tuple								=			floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]  )

						__UpperCamelCase				:  int								=			None
						if self.use_labels:
											__UpperCamelCase				:  str								=			ids_tensor([self.batch_size]				,    self.num_labels  )

						__UpperCamelCase				:  int								=			self.get_config()
						return config, pixel_values, labels






	def 				lowerCamelCase__    (				self		:	Tuple  )  ->					Any:







						"""simple docstring"""







						return EfficientNetConfig(
						    num_channels=self.num_channels				,    kernel_sizes=self.kernel_sizes				,    in_channels=self.in_channels				,    out_channels=self.out_channels				,    strides=self.strides				,    num_block_repeats=self.num_block_repeats				,    expand_ratios=self.expand_ratios				,    hidden_act=self.hidden_act				,    num_labels=self.num_labels				,    )






	def 				lowerCamelCase__    (				self		:	Optional[int]				,    lowerCAmelCase		:	int				,    lowerCAmelCase		:	Tuple				,    lowerCAmelCase		:	Optional[Any]  )  ->					Union[str, Any]:







						"""simple docstring"""







						__UpperCamelCase				:  int								=			EfficientNetModel(config=lowerCAmelCase  )
						model.to(lowerCAmelCase  )
						model.eval()
						__UpperCamelCase				:  Union[str, Any]								=			model(lowerCAmelCase  )
						# expected last hidden states: B, C, H // 4, W // 4
						self.parent.assertEqual(
						    result.last_hidden_state.shape				,    (self.batch_size, config.hidden_dim, self.image_size // 4, self.image_size // 4)				,    )






	def 				lowerCamelCase__    (				self		:	int				,    lowerCAmelCase		:	Union[str, Any]				,    lowerCAmelCase		:	Optional[Any]				,    lowerCAmelCase		:	str  )  ->					Optional[int]:







						"""simple docstring"""







						__UpperCamelCase				:  List[Any]								=			EfficientNetForImageClassification(lowerCAmelCase  )
						model.to(lowerCAmelCase  )
						model.eval()
						__UpperCamelCase				:  Optional[int]								=			model(lowerCAmelCase				,    labels=lowerCAmelCase  )
						self.parent.assertEqual(result.logits.shape				,    (self.batch_size, self.num_labels)  )






	def 				lowerCamelCase__    (				self		:	Optional[Any]  )  ->					Optional[int]:







						"""simple docstring"""







						__UpperCamelCase				:  Optional[int]								=			self.prepare_config_and_inputs()
						__UpperCamelCase			, __UpperCamelCase			, __UpperCamelCase				:  str								=			config_and_inputs
						__UpperCamelCase				:  Optional[Any]								=			{"""pixel_values""": pixel_values}
						return config, inputs_dict






@require_torch
class       SCREAMING_SNAKE_CASE_							(					_UpperCamelCase  ,     _UpperCamelCase  ,     unittest.TestCase      ):



	"""simple docstring"""


	__magic_name__      :					List[Any]			  =		(EfficientNetModel, EfficientNetForImageClassification) if is_torch_available() else ()
	__magic_name__      :					Tuple			  =		(
	    {'feature-extraction': EfficientNetModel, 'image-classification': EfficientNetForImageClassification}
	    if is_torch_available()
	    else {}
	)

	__magic_name__      :					Union[str, Any]			  =		False
	__magic_name__      :					Dict			  =		False
	__magic_name__      :					str			  =		False
	__magic_name__      :					Union[str, Any]			  =		False
	__magic_name__      :					int			  =		False






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







						"""simple docstring"""







						__UpperCamelCase				:  List[str]								=			EfficientNetModelTester(self  )
						__UpperCamelCase				:  Optional[Any]								=			ConfigTester(
						    self				,    config_class=lowerCAmelCase				,    has_text_modality=lowerCAmelCase				,    hidden_size=37  )






	def 				lowerCamelCase__    (				self		:	List[str]  )  ->					int:







						"""simple docstring"""







						self.create_and_test_config_common_properties()
						self.config_tester.create_and_test_config_to_json_string()
						self.config_tester.create_and_test_config_to_json_file()
						self.config_tester.create_and_test_config_from_and_save_pretrained()
						self.config_tester.create_and_test_config_with_num_labels()
						self.config_tester.check_config_can_be_init_without_params()
						self.config_tester.check_config_arguments_init()






	def 				lowerCamelCase__    (				self		:	Optional[Any]  )  ->					Dict:







						"""simple docstring"""







						return






	@unittest.skip(reason="""EfficientNet does not use inputs_embeds"""  )
	def 				lowerCamelCase__    (				self		:	str  )  ->					List[str]:







						"""simple docstring"""







						pass






	@unittest.skip(reason="""EfficientNet does not support input and output embeddings"""  )
	def 				lowerCamelCase__    (				self		:	Optional[Any]  )  ->					Any:







						"""simple docstring"""







						pass






	@unittest.skip(reason="""EfficientNet does not use feedforward chunking"""  )
	def 				lowerCamelCase__    (				self		:	Tuple  )  ->					Optional[int]:







						"""simple docstring"""







						pass






	def 				lowerCamelCase__    (				self		:	Tuple  )  ->					List[str]:







						"""simple docstring"""







						__UpperCamelCase			, __UpperCamelCase				:  Dict								=			self.model_tester.prepare_config_and_inputs_for_common()

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

											__UpperCamelCase				:  Union[str, Any]								=			["""pixel_values"""]
											self.assertListEqual(arg_names[:1]				,    lowerCAmelCase  )






	def 				lowerCamelCase__    (				self		:	Any  )  ->					Optional[int]:







						"""simple docstring"""







						__UpperCamelCase				:  Optional[int]								=			self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_model(*lowerCAmelCase  )






	def 				lowerCamelCase__    (				self		:	Tuple  )  ->					List[Any]:







						"""simple docstring"""







						def check_hidden_states_output(lowerCAmelCase		:	Optional[Any]				,    lowerCAmelCase		:	str				,    lowerCAmelCase		:	Any  ):
											__UpperCamelCase				:  int								=			model_class(lowerCAmelCase  )
											model.to(lowerCAmelCase  )
											model.eval()

											with torch.no_grad():
																__UpperCamelCase				:  Tuple								=			model(**self._prepare_for_class(lowerCAmelCase				,    lowerCAmelCase  )  )

											__UpperCamelCase				:  Any								=			outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states
											__UpperCamelCase				:  Union[str, Any]								=			sum(config.num_block_repeats  ) * 4
											self.assertEqual(len(lowerCAmelCase  )				,    lowerCAmelCase  )

											# EfficientNet's feature maps are of shape (batch_size, num_channels, height, width)
											self.assertListEqual(
											    list(hidden_states[0].shape[-2:]  )				,    [self.model_tester.image_size // 2, self.model_tester.image_size // 2]				,    )

						__UpperCamelCase			, __UpperCamelCase				:  Union[str, Any]								=			self.model_tester.prepare_config_and_inputs_for_common()

						for model_class in self.all_model_classes:
											__UpperCamelCase				:  Union[str, Any]								=			True
											check_hidden_states_output(lowerCAmelCase				,    lowerCAmelCase				,    lowerCAmelCase  )

											# check that output_hidden_states also work using config
											del inputs_dict["output_hidden_states"]
											__UpperCamelCase				:  Optional[Any]								=			True

											check_hidden_states_output(lowerCAmelCase				,    lowerCAmelCase				,    lowerCAmelCase  )






	def 				lowerCamelCase__    (				self		:	List[str]  )  ->					List[Any]:







						"""simple docstring"""







						__UpperCamelCase				:  Optional[Any]								=			self.model_tester.prepare_config_and_inputs()
						self.model_tester.create_and_check_for_image_classification(*lowerCAmelCase  )






	@unittest.skip("""Will be fixed soon by reducing the size of the model used for common tests."""  )
	def 				lowerCamelCase__    (				self		:	Optional[int]  )  ->					Dict:







						"""simple docstring"""







						pass






	@slow
	def 				lowerCamelCase__    (				self		:	str  )  ->					Any:







						"""simple docstring"""







						for model_name in EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											__UpperCamelCase				:  Union[str, Any]								=			EfficientNetModel.from_pretrained(lowerCAmelCase  )
											self.assertIsNotNone(lowerCAmelCase  )






	@is_pipeline_test
	@require_vision
	@slow
	def 				lowerCamelCase__    (				self		:	List[str]  )  ->					Union[str, Any]:







						"""simple docstring"""







						super().test_pipeline_image_classification()






def 							A__   ()    ->	Union[str, Any]:
					__UpperCamelCase				:  List[str]								=			Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""							)
					return image







@require_torch
@require_vision
class       SCREAMING_SNAKE_CASE_							(					unittest.TestCase      ):



	"""simple docstring"""


	@cached_property
	def 				lowerCamelCase__    (				self		:	List[str]  )  ->					Union[str, Any]:







						"""simple docstring"""







						return AutoImageProcessor.from_pretrained("""google/efficientnet-b7"""  ) if is_vision_available() else None






	@slow
	def 				lowerCamelCase__    (				self		:	List[str]  )  ->					Dict:







						"""simple docstring"""







						__UpperCamelCase				:  Optional[Any]								=			EfficientNetForImageClassification.from_pretrained("""google/efficientnet-b7"""  ).to(lowerCAmelCase  )

						__UpperCamelCase				:  Any								=			self.default_image_processor
						__UpperCamelCase				:  Any								=			prepare_img()
						__UpperCamelCase				:  Optional[Any]								=			image_processor(images=lowerCAmelCase				,    return_tensors="""pt"""  ).to(lowerCAmelCase  )

						# forward pass
						with torch.no_grad():
											__UpperCamelCase				:  Tuple								=			model(**lowerCAmelCase  )

						# verify the logits
						__UpperCamelCase				:  Optional[int]								=			torch.Size((1, 1000)  )
						self.assertEqual(outputs.logits.shape				,    lowerCAmelCase  )

						__UpperCamelCase				:  int								=			torch.tensor([0.00_01, 0.00_02, 0.00_02]  ).to(lowerCAmelCase  )
						self.assertTrue(torch.allclose(outputs.logits[0, :3]				,    lowerCAmelCase				,    atol=1E-4  )  )






