






"""simple docstring"""

from __future__ import annotations

import unittest

from transformers import XGLMConfig, XGLMTokenizer, is_tf_available
from transformers.testing_utils import require_tf, slow

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


if is_tf_available():
			import tensorflow as tf

			from transformers.models.xglm.modeling_tf_xglm import (
			    TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST,
			    TFXGLMForCausalLM,
			    TFXGLMModel,
			)

@require_tf
class 						A_							:
				UpperCAmelCase__        =				XGLMConfig
				UpperCAmelCase__        =				{}
				UpperCAmelCase__        =				'''gelu'''







				def __init__(							self							:						Dict						,    __lowerCamelCase							:						str						,    __lowerCamelCase							:						Any=1_4						,    __lowerCamelCase							:						Dict=7						,    __lowerCamelCase							:						Optional[int]=True						,    __lowerCamelCase							:						List[str]=True						,    __lowerCamelCase							:						List[str]=True						,    __lowerCamelCase							:						Optional[Any]=9_9						,    __lowerCamelCase							:						Tuple=3_2						,    __lowerCamelCase							:						Tuple=2						,    __lowerCamelCase							:						Tuple=4						,    __lowerCamelCase							:						str=3_7						,    __lowerCamelCase							:						Union[str, Any]="gelu"						,    __lowerCamelCase							:						int=0.1						,    __lowerCamelCase							:						Optional[int]=0.1						,    __lowerCamelCase							:						List[Any]=5_1_2						,    __lowerCamelCase							:						Dict=0.02						,    )				->					Dict:
										__magic_name__            =     parent
										__magic_name__            =     batch_size
										__magic_name__            =     seq_length
										__magic_name__            =     is_training
										__magic_name__            =     use_input_mask
										__magic_name__            =     use_labels
										__magic_name__            =     vocab_size
										__magic_name__            =     d_model
										__magic_name__            =     num_hidden_layers
										__magic_name__            =     num_attention_heads
										__magic_name__            =     ffn_dim
										__magic_name__            =     activation_function
										__magic_name__            =     activation_dropout
										__magic_name__            =     attention_dropout
										__magic_name__            =     max_position_embeddings
										__magic_name__            =     initializer_range
										__magic_name__            =     None
										__magic_name__            =     0
										__magic_name__            =     2
										__magic_name__            =     1







				def     _snake_case					(							self							:						Union[str, Any]	)				->					Dict:
										return XGLMConfig.from_pretrained("facebook/xglm-564M"	)







				def     _snake_case					(							self							:						Optional[Any]	)				->					Tuple:
										__magic_name__            =     tf.clip_by_value(
										    ids_tensor([self.batch_size, self.seq_length]						,    self.vocab_size	)						,    clip_value_min=0						,    clip_value_max=3	)

										__magic_name__            =     None
										if self.use_input_mask:
																__magic_name__            =     random_attention_mask([self.batch_size, self.seq_length]	)

										__magic_name__            =     self.get_config()

										__magic_name__            =     floats_tensor([self.num_hidden_layers, self.num_attention_heads]						,    2	)

										return (
										    config,
										    input_ids,
										    input_mask,
										    head_mask,
										)







				def     _snake_case					(							self							:						Optional[Any]	)				->					Optional[Any]:
										return XGLMConfig(
										    vocab_size=self.vocab_size						,    d_model=self.hidden_size						,    num_layers=self.num_hidden_layers						,    attention_heads=self.num_attention_heads						,    ffn_dim=self.ffn_dim						,    activation_function=self.activation_function						,    activation_dropout=self.activation_dropout						,    attention_dropout=self.attention_dropout						,    max_position_embeddings=self.max_position_embeddings						,    initializer_range=self.initializer_range						,    use_cache=UpperCAmelCase__						,    bos_token_id=self.bos_token_id						,    eos_token_id=self.eos_token_id						,    pad_token_id=self.pad_token_id						,    return_dict=UpperCAmelCase__						,    )







				def     _snake_case					(							self							:						str	)				->					Optional[Any]:
										__magic_name__            =     self.prepare_config_and_inputs()

										(
										    __magic_name__  
										)            =     config_and_inputs

										__magic_name__            =     {
										    '''input_ids''': input_ids,
										    '''head_mask''': head_mask,
										}

										return config, inputs_dict





@require_tf
class 						A_							(      lowercase__					,							lowercase__					,							unittest.TestCase  ):
				UpperCAmelCase__        =				(TFXGLMModel, TFXGLMForCausalLM) if is_tf_available() else ()
				UpperCAmelCase__        =				(TFXGLMForCausalLM,) if is_tf_available() else ()
				UpperCAmelCase__        =				(
				    {'''feature-extraction''': TFXGLMModel, '''text-generation''': TFXGLMForCausalLM} if is_tf_available() else {}
				)
				UpperCAmelCase__        =				False
				UpperCAmelCase__        =				False
				UpperCAmelCase__        =				False







				def     _snake_case					(							self							:						str	)				->					str:
										__magic_name__            =     TFXGLMModelTester(self	)
										__magic_name__            =     ConfigTester(self						,    config_class=UpperCAmelCase__						,    n_embd=3_7	)







				def     _snake_case					(							self							:						Dict	)				->					Any:
										self.config_tester.run_common_tests()







				@slow
				def     _snake_case					(							self							:						Tuple	)				->					List[str]:
										for model_name in TF_XGLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																__magic_name__            =     TFXGLMModel.from_pretrained(UpperCAmelCase__	)
																self.assertIsNotNone(UpperCAmelCase__	)







				@unittest.skip(reason="Currently, model embeddings are going to undergo a major refactor."	)
				def     _snake_case					(							self							:						List[Any]	)				->					int:
										super().test_resize_token_embeddings()





@require_tf
class 						A_							(      unittest.TestCase  ):







				@slow
				def     _snake_case					(							self							:						List[str]						,    __lowerCamelCase							:						Union[str, Any]=True	)				->					Tuple:
										__magic_name__            =     TFXGLMForCausalLM.from_pretrained("facebook/xglm-564M"	)
										__magic_name__            =     tf.convert_to_tensor([[2, 2_6_8, 9_8_6_5]]						,    dtype=tf.intaa	)  # The dog
										# </s> The dog is a very friendly dog. He is very affectionate and loves to play with other
										# fmt: off
										__magic_name__            =     [2, 2_6_8, 9_8_6_5, 6_7, 1_1, 1_9_8_8, 5_7_2_5_2, 9_8_6_5, 5, 9_8_4, 6_7, 1_9_8_8, 2_1_3_8_3_8, 1_6_5_8, 5_3, 7_0_4_4_6, 3_3, 6_6_5_7, 2_7_8, 1_5_8_1]
										# fmt: on
										__magic_name__            =     model.generate(UpperCAmelCase__						,    do_sample=UpperCAmelCase__						,    num_beams=1	)
										if verify_outputs:
																self.assertListEqual(output_ids[0].numpy().tolist()						,    UpperCAmelCase__	)







				@slow
				def     _snake_case					(							self							:						Dict	)				->					Any:
										__magic_name__            =     XGLMTokenizer.from_pretrained("facebook/xglm-564M"	)
										__magic_name__            =     TFXGLMForCausalLM.from_pretrained("facebook/xglm-564M"	)

										tf.random.set_seed(0	)
										__magic_name__            =     tokenizer("Today is a nice day and"						,    return_tensors="tf"	)
										__magic_name__            =     tokenized.input_ids
										# forces the generation to happen on CPU, to avoid GPU-related quirks (and assure same output regardless of the available devices)
										with tf.device(":/CPU:0"	):
																__magic_name__            =     model.generate(UpperCAmelCase__						,    do_sample=UpperCAmelCase__						,    seed=[7, 0]	)
										__magic_name__            =     tokenizer.decode(output_ids[0]						,    skip_special_tokens=UpperCAmelCase__	)

										__magic_name__            =     (
										    '''Today is a nice day and warm evening here over Southern Alberta!! Today when they closed schools due'''
										)
										self.assertEqual(UpperCAmelCase__						,    UpperCAmelCase__	)







				@slow
				def     _snake_case					(							self							:						Any	)				->					Tuple:
										__magic_name__            =     TFXGLMForCausalLM.from_pretrained("facebook/xglm-564M"	)
										__magic_name__            =     XGLMTokenizer.from_pretrained("facebook/xglm-564M"	)

										__magic_name__            =     '''left'''

										# use different length sentences to test batching
										__magic_name__            =     [
										    '''This is an extremelly long sentence that only exists to test the ability of the model to cope with '''
										    '''left-padding, such as in batched generation. The output for the sequence below should be the same '''
										    '''regardless of whether left padding is applied or not. When''',
										    '''Hello, my dog is a little''',
										]

										__magic_name__            =     tokenizer(UpperCAmelCase__						,    return_tensors="tf"						,    padding=UpperCAmelCase__	)
										__magic_name__            =     inputs['''input_ids''']

										__magic_name__            =     model.generate(input_ids=UpperCAmelCase__						,    attention_mask=inputs["attention_mask"]						,    max_new_tokens=1_2	)

										__magic_name__            =     tokenizer(sentences[0]						,    return_tensors="tf"	).input_ids
										__magic_name__            =     model.generate(input_ids=UpperCAmelCase__						,    max_new_tokens=1_2	)

										__magic_name__            =     tokenizer(sentences[1]						,    return_tensors="tf"	).input_ids
										__magic_name__            =     model.generate(input_ids=UpperCAmelCase__						,    max_new_tokens=1_2	)

										__magic_name__            =     tokenizer.batch_decode(UpperCAmelCase__						,    skip_special_tokens=UpperCAmelCase__	)
										__magic_name__            =     tokenizer.decode(output_non_padded[0]						,    skip_special_tokens=UpperCAmelCase__	)
										__magic_name__            =     tokenizer.decode(output_padded[0]						,    skip_special_tokens=UpperCAmelCase__	)

										__magic_name__            =     [
										    '''This is an extremelly long sentence that only exists to test the ability of the model to cope with '''
										    '''left-padding, such as in batched generation. The output for the sequence below should be the same '''
										    '''regardless of whether left padding is applied or not. When left padding is applied, the sequence will be '''
										    '''a single''',
										    '''Hello, my dog is a little bit of a shy one, but he is very friendly''',
										]
										self.assertListEqual(UpperCAmelCase__						,    UpperCAmelCase__	)
										self.assertListEqual(UpperCAmelCase__						,    [non_padded_sentence, padded_sentence]	)











"""simple docstring"""

from dataclasses import dataclass
from typing import Dict, Optional, Tuple, Union

import torch
import torch.nn as nn

from ..configuration_utils import ConfigMixin, register_to_config
from ..utils import BaseOutput, apply_forward_hook
from .attention_processor import AttentionProcessor, AttnProcessor
from .modeling_utils import ModelMixin
from .vae import Decoder, DecoderOutput, DiagonalGaussianDistribution, Encoder

@dataclass
class 						A_							(      snake_case_  ):
				UpperCAmelCase__        =				42





class 						A_							(      snake_case_					,							snake_case_  ):
				UpperCAmelCase__        =				True







				@register_to_config
				def __init__(							self							:						Any						,    __lowerCamelCase							:						int = 3						,    __lowerCamelCase							:						int = 3						,    __lowerCamelCase							:						Tuple[str] = ("DownEncoderBlock2D",)						,    __lowerCamelCase							:						Tuple[str] = ("UpDecoderBlock2D",)						,    __lowerCamelCase							:						Tuple[int] = (6_4,)						,    __lowerCamelCase							:						int = 1						,    __lowerCamelCase							:						str = "silu"						,    __lowerCamelCase							:						int = 4						,    __lowerCamelCase							:						int = 3_2						,    __lowerCamelCase							:						int = 3_2						,    __lowerCamelCase							:						float = 0.1_8215						,    )				->					Any:
										super().__init__()

										# pass init params to Encoder
										__magic_name__            =     Encoder(
										    in_channels=__lowerCamelCase						,    out_channels=__lowerCamelCase						,    down_block_types=__lowerCamelCase						,    block_out_channels=__lowerCamelCase						,    layers_per_block=__lowerCamelCase						,    act_fn=__lowerCamelCase						,    norm_num_groups=__lowerCamelCase						,    double_z=__lowerCamelCase						,    )

										# pass init params to Decoder
										__magic_name__            =     Decoder(
										    in_channels=__lowerCamelCase						,    out_channels=__lowerCamelCase						,    up_block_types=__lowerCamelCase						,    block_out_channels=__lowerCamelCase						,    layers_per_block=__lowerCamelCase						,    norm_num_groups=__lowerCamelCase						,    act_fn=__lowerCamelCase						,    )

										__magic_name__            =     nn.Convad(2 * latent_channels						,    2 * latent_channels						,    1	)
										__magic_name__            =     nn.Convad(__lowerCamelCase						,    __lowerCamelCase						,    1	)

										__magic_name__            =     False
										__magic_name__            =     False

										# only relevant if vae tiling is enabled
										__magic_name__            =     self.config.sample_size
										__magic_name__            =     (
										    self.config.sample_size[0]
										    if isinstance(self.config.sample_size						,    (list, tuple)	)
										    else self.config.sample_size
										)
										__magic_name__            =     int(sample_size / (2 ** (len(self.config.block_out_channels	) - 1))	)
										__magic_name__            =     0.25







				def     _snake_case					(							self							:						List[str]						,    __lowerCamelCase							:						Tuple						,    __lowerCamelCase							:						Dict=False	)				->					Optional[int]:
										if isinstance(__lowerCamelCase						,    (Encoder, Decoder)	):
																__magic_name__            =     value







				def     _snake_case					(							self							:						Dict						,    __lowerCamelCase							:						bool = True	)				->					int:
										__magic_name__            =     use_tiling







				def     _snake_case					(							self							:						Dict	)				->					Optional[int]:
										self.enable_tiling(__lowerCamelCase	)







				def     _snake_case					(							self							:						int	)				->					str:
										__magic_name__            =     True







				def     _snake_case					(							self							:						Optional[Any]	)				->					Tuple:
										__magic_name__            =     False







				@property
				# Copied from diffusers.models.unet_2d_condition.UNet2DConditionModel.attn_processors
				def     _snake_case					(							self							:						Optional[int]	)				->					Dict[str, AttentionProcessor]:
										__magic_name__            =     {}

										def fn_recursive_add_processors(__lowerCamelCase							:						str						,    __lowerCamelCase							:						torch.nn.Module						,    __lowerCamelCase							:						Dict[str, AttentionProcessor]	):
																if hasattr(__lowerCamelCase						,    "set_processor"	):
																						__magic_name__            =     module.processor

																for sub_name, child in module.named_children():
																						fn_recursive_add_processors(f'''{name}.{sub_name}'''						,    __lowerCamelCase						,    __lowerCamelCase	)

																return processors

										for name, module in self.named_children():
																fn_recursive_add_processors(__lowerCamelCase						,    __lowerCamelCase						,    __lowerCamelCase	)

										return processors







				def     _snake_case					(							self							:						Dict						,    __lowerCamelCase							:						Union[AttentionProcessor, Dict[str, AttentionProcessor]]	)				->					int:
										__magic_name__            =     len(self.attn_processors.keys()	)

										if isinstance(__lowerCamelCase						,    __lowerCamelCase	) and len(__lowerCamelCase	) != count:
																raise ValueError(
																    f'''A dict of processors was passed, but the number of processors {len(__lowerCamelCase	)} does not match the'''
																    f''' number of attention layers: {count}. Please make sure to pass {count} processor classes.'''	)

										def fn_recursive_attn_processor(__lowerCamelCase							:						str						,    __lowerCamelCase							:						torch.nn.Module						,    __lowerCamelCase							:						List[str]	):
																if hasattr(__lowerCamelCase						,    "set_processor"	):
																						if not isinstance(__lowerCamelCase						,    __lowerCamelCase	):
																												module.set_processor(__lowerCamelCase	)
																						else:
																												module.set_processor(processor.pop(f'''{name}.processor'''	)	)

																for sub_name, child in module.named_children():
																						fn_recursive_attn_processor(f'''{name}.{sub_name}'''						,    __lowerCamelCase						,    __lowerCamelCase	)

										for name, module in self.named_children():
																fn_recursive_attn_processor(__lowerCamelCase						,    __lowerCamelCase						,    __lowerCamelCase	)







				def     _snake_case					(							self							:						List[Any]	)				->					Optional[Any]:
										self.set_attn_processor(AttnProcessor()	)







				@apply_forward_hook
				def     _snake_case					(							self							:						str						,    __lowerCamelCase							:						torch.FloatTensor						,    __lowerCamelCase							:						bool = True	)				->					AutoencoderKLOutput:
										if self.use_tiling and (x.shape[-1] > self.tile_sample_min_size or x.shape[-2] > self.tile_sample_min_size):
																return self.tiled_encode(__lowerCamelCase						,    return_dict=__lowerCamelCase	)

										if self.use_slicing and x.shape[0] > 1:
																__magic_name__            =     [self.encoder(__lowerCamelCase	) for x_slice in x.split(1	)]
																__magic_name__            =     torch.cat(__lowerCamelCase	)
										else:
																__magic_name__            =     self.encoder(__lowerCamelCase	)

										__magic_name__            =     self.quant_conv(__lowerCamelCase	)
										__magic_name__            =     DiagonalGaussianDistribution(__lowerCamelCase	)

										if not return_dict:
																return (posterior,)

										return AutoencoderKLOutput(latent_dist=__lowerCamelCase	)







				def     _snake_case					(							self							:						int						,    __lowerCamelCase							:						torch.FloatTensor						,    __lowerCamelCase							:						bool = True	)				->					Union[DecoderOutput, torch.FloatTensor]:
										if self.use_tiling and (z.shape[-1] > self.tile_latent_min_size or z.shape[-2] > self.tile_latent_min_size):
																return self.tiled_decode(__lowerCamelCase						,    return_dict=__lowerCamelCase	)

										__magic_name__            =     self.post_quant_conv(__lowerCamelCase	)
										__magic_name__            =     self.decoder(__lowerCamelCase	)

										if not return_dict:
																return (dec,)

										return DecoderOutput(sample=__lowerCamelCase	)







				@apply_forward_hook
				def     _snake_case					(							self							:						Optional[Any]						,    __lowerCamelCase							:						torch.FloatTensor						,    __lowerCamelCase							:						bool = True	)				->					Union[DecoderOutput, torch.FloatTensor]:
										if self.use_slicing and z.shape[0] > 1:
																__magic_name__            =     [self._decode(__lowerCamelCase	).sample for z_slice in z.split(1	)]
																__magic_name__            =     torch.cat(__lowerCamelCase	)
										else:
																__magic_name__            =     self._decode(__lowerCamelCase	).sample

										if not return_dict:
																return (decoded,)

										return DecoderOutput(sample=__lowerCamelCase	)







				def     _snake_case					(							self							:						Optional[int]						,    __lowerCamelCase							:						str						,    __lowerCamelCase							:						List[str]						,    __lowerCamelCase							:						Dict	)				->					Optional[int]:
										__magic_name__            =     min(a.shape[2]						,    b.shape[2]						,    __lowerCamelCase	)
										for y in range(__lowerCamelCase	):
																__magic_name__            =     a[:, :, -blend_extent + y, :] * (1 - y / blend_extent) + b[:, :, y, :] * (y / blend_extent)
										return b







				def     _snake_case					(							self							:						List[str]						,    __lowerCamelCase							:						Any						,    __lowerCamelCase							:						Tuple						,    __lowerCamelCase							:						Tuple	)				->					Optional[int]:
										__magic_name__            =     min(a.shape[3]						,    b.shape[3]						,    __lowerCamelCase	)
										for x in range(__lowerCamelCase	):
																__magic_name__            =     a[:, :, :, -blend_extent + x] * (1 - x / blend_extent) + b[:, :, :, x] * (x / blend_extent)
										return b







				def     _snake_case					(							self							:						Optional[int]						,    __lowerCamelCase							:						torch.FloatTensor						,    __lowerCamelCase							:						bool = True	)				->					AutoencoderKLOutput:
										__magic_name__            =     int(self.tile_sample_min_size * (1 - self.tile_overlap_factor)	)
										__magic_name__            =     int(self.tile_latent_min_size * self.tile_overlap_factor	)
										__magic_name__            =     self.tile_latent_min_size - blend_extent

										# Split the image into 512x512 tiles and encode them separately.
										__magic_name__            =     []
										for i in range(0						,    x.shape[2]						,    __lowerCamelCase	):
																__magic_name__            =     []
																for j in range(0						,    x.shape[3]						,    __lowerCamelCase	):
																						__magic_name__            =     x[:, :, i : i + self.tile_sample_min_size, j : j + self.tile_sample_min_size]
																						__magic_name__            =     self.encoder(__lowerCamelCase	)
																						__magic_name__            =     self.quant_conv(__lowerCamelCase	)
																						row.append(__lowerCamelCase	)
																rows.append(__lowerCamelCase	)
										__magic_name__            =     []
										for i, row in enumerate(__lowerCamelCase	):
																__magic_name__            =     []
																for j, tile in enumerate(__lowerCamelCase	):
																						# blend the above tile and the left tile
																						# to the current tile and add the current tile to the result row
																						if i > 0:
																												__magic_name__            =     self.blend_v(rows[i - 1][j]						,    __lowerCamelCase						,    __lowerCamelCase	)
																						if j > 0:
																												__magic_name__            =     self.blend_h(row[j - 1]						,    __lowerCamelCase						,    __lowerCamelCase	)
																						result_row.append(tile[:, :, :row_limit, :row_limit]	)
																result_rows.append(torch.cat(__lowerCamelCase						,    dim=3	)	)

										__magic_name__            =     torch.cat(__lowerCamelCase						,    dim=2	)
										__magic_name__            =     DiagonalGaussianDistribution(__lowerCamelCase	)

										if not return_dict:
																return (posterior,)

										return AutoencoderKLOutput(latent_dist=__lowerCamelCase	)







				def     _snake_case					(							self							:						str						,    __lowerCamelCase							:						torch.FloatTensor						,    __lowerCamelCase							:						bool = True	)				->					Union[DecoderOutput, torch.FloatTensor]:
										__magic_name__            =     int(self.tile_latent_min_size * (1 - self.tile_overlap_factor)	)
										__magic_name__            =     int(self.tile_sample_min_size * self.tile_overlap_factor	)
										__magic_name__            =     self.tile_sample_min_size - blend_extent

										# Split z into overlapping 64x64 tiles and decode them separately.
										# The tiles have an overlap to avoid seams between tiles.
										__magic_name__            =     []
										for i in range(0						,    z.shape[2]						,    __lowerCamelCase	):
																__magic_name__            =     []
																for j in range(0						,    z.shape[3]						,    __lowerCamelCase	):
																						__magic_name__            =     z[:, :, i : i + self.tile_latent_min_size, j : j + self.tile_latent_min_size]
																						__magic_name__            =     self.post_quant_conv(__lowerCamelCase	)
																						__magic_name__            =     self.decoder(__lowerCamelCase	)
																						row.append(__lowerCamelCase	)
																rows.append(__lowerCamelCase	)
										__magic_name__            =     []
										for i, row in enumerate(__lowerCamelCase	):
																__magic_name__            =     []
																for j, tile in enumerate(__lowerCamelCase	):
																						# blend the above tile and the left tile
																						# to the current tile and add the current tile to the result row
																						if i > 0:
																												__magic_name__            =     self.blend_v(rows[i - 1][j]						,    __lowerCamelCase						,    __lowerCamelCase	)
																						if j > 0:
																												__magic_name__            =     self.blend_h(row[j - 1]						,    __lowerCamelCase						,    __lowerCamelCase	)
																						result_row.append(tile[:, :, :row_limit, :row_limit]	)
																result_rows.append(torch.cat(__lowerCamelCase						,    dim=3	)	)

										__magic_name__            =     torch.cat(__lowerCamelCase						,    dim=2	)
										if not return_dict:
																return (dec,)

										return DecoderOutput(sample=__lowerCamelCase	)







				def     _snake_case					(							self							:						List[str]						,    __lowerCamelCase							:						torch.FloatTensor						,    __lowerCamelCase							:						bool = False						,    __lowerCamelCase							:						bool = True						,    __lowerCamelCase							:						Optional[torch.Generator] = None						,    )				->					Union[DecoderOutput, torch.FloatTensor]:
										__magic_name__            =     sample
										__magic_name__            =     self.encode(__lowerCamelCase	).latent_dist
										if sample_posterior:
																__magic_name__            =     posterior.sample(generator=__lowerCamelCase	)
										else:
																__magic_name__            =     posterior.mode()
										__magic_name__            =     self.decode(__lowerCamelCase	).sample

										if not return_dict:
																return (dec,)

										return DecoderOutput(sample=__lowerCamelCase	)



