"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_torch_available


_UpperCamelCase       :						Any     =   {"configuration_bert_generation": ["BertGenerationConfig"]}

try:
       if not is_sentencepiece_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _UpperCamelCase       :						Dict     =   ["BertGenerationTokenizer"]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _UpperCamelCase       :						int     =   [
           "BertGenerationDecoder",
           "BertGenerationEncoder",
           "BertGenerationPreTrainedModel",
           "load_tf_weights_in_bert_generation",
       ]


if TYPE_CHECKING:
       from .configuration_bert_generation import BertGenerationConfig

       try:
              if not is_sentencepiece_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_bert_generation import BertGenerationTokenizer

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_bert_generation import (
                  BertGenerationDecoder,
                  BertGenerationEncoder,
                  BertGenerationPreTrainedModel,
                  load_tf_weights_in_bert_generation,
              )

else:
       import sys

       _UpperCamelCase       :						Optional[Any]     =   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


"""simple docstring"""





import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig


class 					UpperCAmelCase_     (   _a):
      lowerCamelCase__		:   List[str]			  =  CustomConfig


      def __init__(       self		,      a							)	-> Optional[int]:
             super().__init__(a							)
             lowercase__      :		Any          =     torch.nn.Linear(config.hidden_size		,      config.hidden_size							)


      def 		_UpperCAmelCase	(       self		,      a							)	-> Union[str, Any]:
             return self.linear(a							)


      def 		_UpperCAmelCase	(       self		,      a							)	-> Tuple:
             pass





class 					UpperCAmelCase_     (   _a):
      lowerCamelCase__		:   Optional[int]			  =  NoSuperInitConfig


      def __init__(       self		,      a							)	-> int:
             super().__init__(a							)
             lowercase__      :		List[Any]          =     torch.nn.Linear(config.attribute		,      config.attribute							)


      def 		_UpperCAmelCase	(       self		,      a							)	-> Optional[int]:
             return self.linear(a							)


      def 		_UpperCAmelCase	(       self		,      a							)	-> Optional[Any]:
             pass

