
import copy
import fnmatch
import json
import os
import pickle as pkl
import shutil
import sys
import tarfile
import tempfile
from collections import OrderedDict
from contextlib import contextmanager
from functools import partial
from hashlib import shaaaa
from io import BytesIO
from pathlib import Path
from urllib.parse import urlparse
from zipfile import ZipFile, is_zipfile

import cva
import numpy as np
import requests
import wget
from filelock import FileLock
from PIL import Image
from tqdm.auto import tqdm
from yaml import Loader, dump, load


try:
   import torch

   __UpperCAmelCase   						=     True
except ImportError:
   __UpperCAmelCase   						=     False


try:
   from torch.hub import _get_torch_home

   __UpperCAmelCase   						=     _get_torch_home()
except ImportError:
   __UpperCAmelCase   						=     os.path.expanduser(
       os.getenv("TORCH_HOME", os.path.join(os.getenv("XDG_CACHE_HOME", "~/.cache"), "torch"))
   )

__UpperCAmelCase   						=     os.path.join(torch_cache_home, "transformers")

__UpperCAmelCase   						=     "https://cdn.huggingface.co"
__UpperCAmelCase   						=     "https://s3.amazonaws.com/models.huggingface.co/bert"
__UpperCAmelCase   						=     "/".join(str(Path(__file__).resolve()).split("/")[:-1])
__UpperCAmelCase   						=     os.path.join(PATH, "config.yaml")
__UpperCAmelCase   						=     os.path.join(PATH, "attributes.txt")
__UpperCAmelCase   						=     os.path.join(PATH, "objects.txt")
__UpperCAmelCase   						=     os.getenv("PYTORCH_PRETRAINED_BERT_CACHE", default_cache_path)
__UpperCAmelCase   						=     os.getenv("PYTORCH_TRANSFORMERS_CACHE", PYTORCH_PRETRAINED_BERT_CACHE)
__UpperCAmelCase   						=     os.getenv("TRANSFORMERS_CACHE", PYTORCH_TRANSFORMERS_CACHE)
__UpperCAmelCase   						=     "pytorch_model.bin"
__UpperCAmelCase   						=     "config.yaml"


def  A__ (       __lowerCamelCase=OBJECTS,  __lowerCamelCase=ATTRIBUTES						):
   SCREAMING_SNAKE_CASE_	=      []
   with open(__lowerCamelCase						) as f:
      for object in f.readlines():
         vg_classes.append(object.split(''','''						)[0].lower().strip()						)

   SCREAMING_SNAKE_CASE_	=      []
   with open(__lowerCamelCase						) as f:
      for object in f.readlines():
         vg_attrs.append(object.split(''','''						)[0].lower().strip()						)
   return vg_classes, vg_attrs


def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      OrderedDict()
   with open(__lowerCamelCase,  '''rb'''						) as f:
      SCREAMING_SNAKE_CASE_	=      pkl.load(__lowerCamelCase						)['''model''']
   for k in copy.deepcopy(list(ckp.keys()						)						):
      SCREAMING_SNAKE_CASE_	=      ckp.pop(__lowerCamelCase						)
      if isinstance(__lowerCamelCase,  np.ndarray						):
         SCREAMING_SNAKE_CASE_	=      torch.tensor(__lowerCamelCase						)
      else:
         assert isinstance(__lowerCamelCase,  torch.tensor						), type(__lowerCamelCase						)
      SCREAMING_SNAKE_CASE_	=      v
   return r





class 				UpperCamelCase__		:






       """simple docstring"""


       UpperCAmelCase_				       ={}



       def __init__(							self ,     _A ,     _A = "root" ,     _A=0	)				->				str:
          SCREAMING_SNAKE_CASE_	=      name
          SCREAMING_SNAKE_CASE_	=      level
          SCREAMING_SNAKE_CASE_	=      {}
          for k, v in dictionary.items():
             if v is None:
                raise ValueError()
             SCREAMING_SNAKE_CASE_	=      copy.deepcopy(_A	)
             SCREAMING_SNAKE_CASE_	=      copy.deepcopy(_A	)
             if isinstance(_A ,     _A	):
                SCREAMING_SNAKE_CASE_	=      Config(_A ,     name=_A ,     level=level + 1	)
             SCREAMING_SNAKE_CASE_	=      v
             setattr(self ,     _A ,     _A	)

          SCREAMING_SNAKE_CASE_	=      d



       def __repr__(							self	)				->				Optional[Any]:
          return str(list((self._pointer.keys())	)	)



       def __setattr__(							self ,     _A ,     _A	)				->				Union[str, Any]:
          SCREAMING_SNAKE_CASE_	=      val
          SCREAMING_SNAKE_CASE_	=      val
          SCREAMING_SNAKE_CASE_	=      key.split('''.'''	)
          SCREAMING_SNAKE_CASE_	=      len(_A	) - 1
          SCREAMING_SNAKE_CASE_	=      self._pointer
          if len(_A	) > 1:
             for i, l in enumerate(_A	):
                if hasattr(self ,     _A	) and isinstance(getattr(self ,     _A	) ,     _A	):
                   setattr(getattr(self ,     _A	) ,     '''.'''.join(levels[i:]	) ,     _A	)
                if l == last_level:
                   SCREAMING_SNAKE_CASE_	=      val
                else:
                   SCREAMING_SNAKE_CASE_	=      pointer[l]



       def     _UpperCamelCase	(							self	)				->				Tuple:
          return self._pointer



       def     _UpperCamelCase	(							self ,     _A ,     _A	)				->				Tuple:
          with open(F'''{file_name}''' ,     '''w'''	) as stream:
             dump(_A ,     _A	)



       def     _UpperCamelCase	(							self ,     _A ,     _A	)				->				Optional[Any]:
          with open(F'''{file_name}''' ,     '''w'''	) as stream:
             json.dump(_A ,     _A	)



       @staticmethod
       def     _UpperCamelCase	(							_A	)				->				List[Any]:
          with open(_A	) as stream:
             SCREAMING_SNAKE_CASE_	=      load(_A ,     Loader=_A	)
          return data



       def __str__(							self	)				->				List[str]:
          SCREAMING_SNAKE_CASE_	=      '''    '''
          if self._name != "root":
             SCREAMING_SNAKE_CASE_	=      F'''{t * (self._level-1)}{self._name}:\n'''
          else:
             SCREAMING_SNAKE_CASE_	=      ''''''
          SCREAMING_SNAKE_CASE_	=      self._level
          for i, (k, v) in enumerate(self._pointer.items()	):
             if isinstance(_A ,     _A	):
                r += F'''{t * (self._level)}{v}\n'''
                self._level += 1
             else:
                r += F'''{t * (self._level)}{k}: {v} ({type(_A	).__name__})\n'''
             SCREAMING_SNAKE_CASE_	=      level
          return r[:-1]



       @classmethod
       def     _UpperCamelCase	(							cls ,     _A ,     **_A	)				->				Optional[Any]:
          SCREAMING_SNAKE_CASE_	, SCREAMING_SNAKE_CASE_	=      cls.get_config_dict(_A ,     **_A	)
          return cls(_A	)




       @classmethod
       def     _UpperCamelCase	(							cls ,     _A ,     **_A	)				->				Optional[int]:
          SCREAMING_SNAKE_CASE_	=      kwargs.pop('''cache_dir''' ,     _A	)
          SCREAMING_SNAKE_CASE_	=      kwargs.pop('''force_download''' ,     _A	)
          SCREAMING_SNAKE_CASE_	=      kwargs.pop('''resume_download''' ,     _A	)
          SCREAMING_SNAKE_CASE_	=      kwargs.pop('''proxies''' ,     _A	)
          SCREAMING_SNAKE_CASE_	=      kwargs.pop('''local_files_only''' ,     _A	)

          if os.path.isdir(_A	):
             SCREAMING_SNAKE_CASE_	=      os.path.join(_A ,     _A	)
          elif os.path.isfile(_A	) or is_remote_url(_A	):
             SCREAMING_SNAKE_CASE_	=      pretrained_model_name_or_path
          else:
             SCREAMING_SNAKE_CASE_	=      hf_bucket_url(_A ,     filename=_A ,     use_cdn=_A	)

          try:
             # Load from URL or cache if already cached
             SCREAMING_SNAKE_CASE_	=      cached_path(
                 _A ,     cache_dir=_A ,     force_download=_A ,     proxies=_A ,     resume_download=_A ,     local_files_only=_A ,     )
             # Load config dict
             if resolved_config_file is None:
                raise EnvironmentError

             SCREAMING_SNAKE_CASE_	=      Config.load_yaml(_A	)

          except EnvironmentError:
             SCREAMING_SNAKE_CASE_	=      '''Can\'t load config for'''
             raise EnvironmentError(_A	)

          if resolved_config_file == config_file:
             print('''loading configuration file from path'''	)
          else:
             print('''loading configuration file cache'''	)

          return Config.load_yaml(_A	), kwargs







def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      torch.load('''dump.pt''',  map_location=in_tensor.device						)
   SCREAMING_SNAKE_CASE_	=      in_tensor.numpy()
   SCREAMING_SNAKE_CASE_	=      out_tensor.numpy()[0]
   print(na.shape,  na[0, 0, :5]						)
   print(na.shape,  na[0, 0, :5]						)
   assert np.allclose(__lowerCamelCase,  __lowerCamelCase,  rtol=0.01,  atol=0.1						), (
       F'''{sum([1 for x in np.isclose(__lowerCamelCase,  __lowerCamelCase,  rtol=0.01,  atol=0.1						).flatten() if x is False]						)/len(na.flatten()						)*1_00:.4f} %'''
       " element-wise mismatch"
   )
   raise Exception('''tensors are all good'''						)

   # Hugging face functions below


def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      urlparse(__lowerCamelCase						)
   return parsed.scheme in ("http", "https")


def  A__ (       __lowerCamelCase,  __lowerCamelCase,  __lowerCamelCase=True						):
   SCREAMING_SNAKE_CASE_	=      CLOUDFRONT_DISTRIB_PREFIX if use_cdn else S3_BUCKET_PREFIX
   SCREAMING_SNAKE_CASE_	=      '''/''' not in model_id
   if legacy_format:
      return F'''{endpoint}/{model_id}-{filename}'''
   else:
      return F'''{endpoint}/{model_id}/{filename}'''


def  A__ (       __lowerCamelCase,  __lowerCamelCase,  __lowerCamelCase=None,  __lowerCamelCase=0,  __lowerCamelCase=None,  ):
   SCREAMING_SNAKE_CASE_	=      '''python/{}'''.format(sys.version.split()[0]						)
   if _torch_available:
      ua += "; torch/{}".format(torch.__version__						)
   if isinstance(__lowerCamelCase,  __lowerCamelCase						):
      ua += "; " + "; ".join('''{}/{}'''.format(__lowerCamelCase,  __lowerCamelCase						) for k, v in user_agent.items()						)
   elif isinstance(__lowerCamelCase,  __lowerCamelCase						):
      ua += "; " + user_agent
   SCREAMING_SNAKE_CASE_	=      {'''user-agent''': ua}
   if resume_size > 0:
      SCREAMING_SNAKE_CASE_	=      '''bytes=%d-''' % (resume_size,)
   SCREAMING_SNAKE_CASE_	=      requests.get(__lowerCamelCase,  stream=__lowerCamelCase,  proxies=__lowerCamelCase,  headers=__lowerCamelCase						)
   if response.status_code == 4_16:  # Range not satisfiable
      return
   SCREAMING_SNAKE_CASE_	=      response.headers.get('''Content-Length'''						)
   SCREAMING_SNAKE_CASE_	=      resume_size + int(__lowerCamelCase						) if content_length is not None else None
   SCREAMING_SNAKE_CASE_	=      tqdm(
       unit='''B''',  unit_scale=__lowerCamelCase,  total=__lowerCamelCase,  initial=__lowerCamelCase,  desc='''Downloading''',  )
   for chunk in response.iter_content(chunk_size=10_24						):
      if chunk:  # filter out keep-alive new chunks
         progress.update(len(__lowerCamelCase						)						)
         temp_file.write(__lowerCamelCase						)
   progress.close()


def  A__ (       __lowerCamelCase,  __lowerCamelCase=None,  __lowerCamelCase=False,  __lowerCamelCase=None,  __lowerCamelCase=10,  __lowerCamelCase=False,  __lowerCamelCase=None,  __lowerCamelCase=False,  ):
   if cache_dir is None:
      SCREAMING_SNAKE_CASE_	=      TRANSFORMERS_CACHE
   if isinstance(__lowerCamelCase,  __lowerCamelCase						):
      SCREAMING_SNAKE_CASE_	=      str(__lowerCamelCase						)

   os.makedirs(__lowerCamelCase,  exist_ok=__lowerCamelCase						)

   SCREAMING_SNAKE_CASE_	=      None
   if not local_files_only:
      try:
         SCREAMING_SNAKE_CASE_	=      requests.head(__lowerCamelCase,  allow_redirects=__lowerCamelCase,  proxies=__lowerCamelCase,  timeout=__lowerCamelCase						)
         if response.status_code == 2_00:
            SCREAMING_SNAKE_CASE_	=      response.headers.get('''ETag'''						)
      except (EnvironmentError, requests.exceptions.Timeout):
         # etag is already None
         pass

   SCREAMING_SNAKE_CASE_	=      url_to_filename(__lowerCamelCase,  __lowerCamelCase						)

   # get cache path to put the file
   SCREAMING_SNAKE_CASE_	=      os.path.join(__lowerCamelCase,  __lowerCamelCase						)

   # etag is None = we don't have a connection, or url doesn't exist, or is otherwise inaccessible.
   # try to get the last downloaded one
   if etag is None:
      if os.path.exists(__lowerCamelCase						):
         return cache_path
      else:
         SCREAMING_SNAKE_CASE_	=      [
             file
             for file in fnmatch.filter(os.listdir(__lowerCamelCase						),  filename + '''.*'''						)
             if not file.endswith('''.json'''						) and not file.endswith('''.lock'''						)
         ]
         if len(__lowerCamelCase						) > 0:
            return os.path.join(__lowerCamelCase,  matching_files[-1]						)
         else:
            # If files cannot be found and local_files_only=True,
            # the models might've been found if local_files_only=False
            # Notify the user about that
            if local_files_only:
               raise ValueError(
                   '''Cannot find the requested files in the cached path and outgoing traffic has been'''
                   ''' disabled. To enable model look-ups and downloads online, set \'local_files_only\''''
                   ''' to False.'''						)
            return None

    # From now on, etag is not None.
   if os.path.exists(__lowerCamelCase						) and not force_download:
      return cache_path

   # Prevent parallel downloads of the same file with a lock.
   SCREAMING_SNAKE_CASE_	=      cache_path + '''.lock'''
   with FileLock(__lowerCamelCase						):
      # If the download just completed while the lock was activated.
      if os.path.exists(__lowerCamelCase						) and not force_download:
         # Even if returning early like here, the lock will be released.
         return cache_path

      if resume_download:
         SCREAMING_SNAKE_CASE_	=      cache_path + '''.incomplete'''

         @contextmanager
         def _resumable_file_manager():
            with open(__lowerCamelCase,  '''a+b'''						) as f:
               yield f

         SCREAMING_SNAKE_CASE_	=      _resumable_file_manager
         if os.path.exists(__lowerCamelCase						):
            SCREAMING_SNAKE_CASE_	=      os.stat(__lowerCamelCase						).st_size
         else:
            SCREAMING_SNAKE_CASE_	=      0
      else:
         SCREAMING_SNAKE_CASE_	=      partial(tempfile.NamedTemporaryFile,  dir=__lowerCamelCase,  delete=__lowerCamelCase						)
         SCREAMING_SNAKE_CASE_	=      0

      # Download to temporary file, then copy to cache dir once finished.
      # Otherwise you get corrupt cache entries if the download gets interrupted.
      with temp_file_manager() as temp_file:
         print(
             '''%s not found in cache or force_download set to True, downloading to %s''',  __lowerCamelCase,  temp_file.name,  )

         http_get(
             __lowerCamelCase,  __lowerCamelCase,  proxies=__lowerCamelCase,  resume_size=__lowerCamelCase,  user_agent=__lowerCamelCase,  )

      os.replace(temp_file.name,  __lowerCamelCase						)

      SCREAMING_SNAKE_CASE_	=      {'''url''': url, '''etag''': etag}
      SCREAMING_SNAKE_CASE_	=      cache_path + '''.json'''
      with open(__lowerCamelCase,  '''w'''						) as meta_file:
         json.dump(__lowerCamelCase,  __lowerCamelCase						)

   return cache_path


def  A__ (       __lowerCamelCase,  __lowerCamelCase=None						):
   SCREAMING_SNAKE_CASE_	=      url.encode('''utf-8'''						)
   SCREAMING_SNAKE_CASE_	=      shaaaa(__lowerCamelCase						)
   SCREAMING_SNAKE_CASE_	=      url_hash.hexdigest()

   if etag:
      SCREAMING_SNAKE_CASE_	=      etag.encode('''utf-8'''						)
      SCREAMING_SNAKE_CASE_	=      shaaaa(__lowerCamelCase						)
      filename += "." + etag_hash.hexdigest()

   if url.endswith('''.h5'''						):
      filename += ".h5"

   return filename


def  A__ (       __lowerCamelCase,  __lowerCamelCase=None,  __lowerCamelCase=False,  __lowerCamelCase=None,  __lowerCamelCase=False,  __lowerCamelCase=None,  __lowerCamelCase=False,  __lowerCamelCase=False,  __lowerCamelCase=False,  ):
   if cache_dir is None:
      SCREAMING_SNAKE_CASE_	=      TRANSFORMERS_CACHE
   if isinstance(__lowerCamelCase,  __lowerCamelCase						):
      SCREAMING_SNAKE_CASE_	=      str(__lowerCamelCase						)
   if isinstance(__lowerCamelCase,  __lowerCamelCase						):
      SCREAMING_SNAKE_CASE_	=      str(__lowerCamelCase						)

   if is_remote_url(__lowerCamelCase						):
      # URL, so get it from the cache (downloading if necessary)
      SCREAMING_SNAKE_CASE_	=      get_from_cache(
          __lowerCamelCase,  cache_dir=__lowerCamelCase,  force_download=__lowerCamelCase,  proxies=__lowerCamelCase,  resume_download=__lowerCamelCase,  user_agent=__lowerCamelCase,  local_files_only=__lowerCamelCase,  )
   elif os.path.exists(__lowerCamelCase						):
      # File, and it exists.
      SCREAMING_SNAKE_CASE_	=      url_or_filename
   elif urlparse(__lowerCamelCase						).scheme == "":
      # File, but it doesn't exist.
      raise EnvironmentError('''file {} not found'''.format(__lowerCamelCase						)						)
   else:
      # Something unknown
      raise ValueError('''unable to parse {} as a URL or as a local path'''.format(__lowerCamelCase						)						)

   if extract_compressed_file:
      if not is_zipfile(__lowerCamelCase						) and not tarfile.is_tarfile(__lowerCamelCase						):
         return output_path

      # Path where we extract compressed archives
      # We avoid '.' in dir name and add "-extracted" at the end: "./model.zip" => "./model-zip-extracted/"
      SCREAMING_SNAKE_CASE_	, SCREAMING_SNAKE_CASE_	=      os.path.split(__lowerCamelCase						)
      SCREAMING_SNAKE_CASE_	=      output_file.replace('''.''',  '''-'''						) + '''-extracted'''
      SCREAMING_SNAKE_CASE_	=      os.path.join(__lowerCamelCase,  __lowerCamelCase						)

      if os.path.isdir(__lowerCamelCase						) and os.listdir(__lowerCamelCase						) and not force_extract:
         return output_path_extracted

      # Prevent parallel extractions
      SCREAMING_SNAKE_CASE_	=      output_path + '''.lock'''
      with FileLock(__lowerCamelCase						):
         shutil.rmtree(__lowerCamelCase,  ignore_errors=__lowerCamelCase						)
         os.makedirs(__lowerCamelCase						)
         if is_zipfile(__lowerCamelCase						):
            with ZipFile(__lowerCamelCase,  '''r'''						) as zip_file:
               zip_file.extractall(__lowerCamelCase						)
               zip_file.close()
         elif tarfile.is_tarfile(__lowerCamelCase						):
            SCREAMING_SNAKE_CASE_	=      tarfile.open(__lowerCamelCase						)
            tar_file.extractall(__lowerCamelCase						)
            tar_file.close()
         else:
            raise EnvironmentError('''Archive format of {} could not be identified'''.format(__lowerCamelCase						)						)

      return output_path_extracted

   return output_path


def  A__ (       __lowerCamelCase,  __lowerCamelCase=","						):
   assert isinstance(__lowerCamelCase,  __lowerCamelCase						)
   if os.path.isfile(__lowerCamelCase						):
      with open(__lowerCamelCase						) as f:
         SCREAMING_SNAKE_CASE_	=      eval(f.read()						)
   else:
      SCREAMING_SNAKE_CASE_	=      requests.get(__lowerCamelCase						)
      try:
         SCREAMING_SNAKE_CASE_	=      requests.json()
      except Exception:
         SCREAMING_SNAKE_CASE_	=      req.content.decode()
         assert data is not None, "could not connect"
         try:
            SCREAMING_SNAKE_CASE_	=      eval(__lowerCamelCase						)
         except Exception:
            SCREAMING_SNAKE_CASE_	=      data.split('''\n'''						)
      req.close()
   return data


def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      requests.get(__lowerCamelCase						)
   SCREAMING_SNAKE_CASE_	=      np.array(Image.open(BytesIO(response.content						)						)						)
   return img


def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      url.split('''/'''						)[-1]
   if fn not in os.listdir(os.getcwd()						):
      wget.download(__lowerCamelCase						)
   with open(__lowerCamelCase,  '''rb'''						) as stream:
      SCREAMING_SNAKE_CASE_	=      pkl.load(__lowerCamelCase						)
   SCREAMING_SNAKE_CASE_	=      weights.pop('''model'''						)
   SCREAMING_SNAKE_CASE_	=      {}
   for k, v in model.items():
      SCREAMING_SNAKE_CASE_	=      torch.from_numpy(__lowerCamelCase						)
      if "running_var" in k:
         SCREAMING_SNAKE_CASE_	=      torch.tensor([0]						)
         SCREAMING_SNAKE_CASE_	=      k.replace('''running_var''',  '''num_batches_tracked'''						)
         SCREAMING_SNAKE_CASE_	=      zero
   return new


def  A__ (       ):
   print(F'''{os.path.abspath(os.path.join(__lowerCamelCase,  os.pardir						)						)}/demo.ipynb'''						)


def  A__ (       __lowerCamelCase,  __lowerCamelCase="RGB"						):
   assert isinstance(__lowerCamelCase,  __lowerCamelCase						)
   if os.path.isfile(__lowerCamelCase						):
      SCREAMING_SNAKE_CASE_	=      cva.imread(__lowerCamelCase						)
   else:
      SCREAMING_SNAKE_CASE_	=      get_image_from_url(__lowerCamelCase						)
      assert img is not None, F'''could not connect to: {im}'''
   SCREAMING_SNAKE_CASE_	=      cva.cvtColor(__lowerCamelCase,  cva.COLOR_BGR2RGB						)
   if input_format == "RGB":
      SCREAMING_SNAKE_CASE_	=      img[:, :, ::-1]
   return img





def  A__ (       __lowerCamelCase,  __lowerCamelCase=1						):
   return (images[i : i + batch] for i in range(0,  len(__lowerCamelCase						),  __lowerCamelCase						))




import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig





class 				UpperCamelCase__		(	__SCREAMING_SNAKE_CASE	):






       """simple docstring"""


       UpperCAmelCase_				       =CustomConfig



       def __init__(							self ,     _A	)				->				int:
          super().__init__(_A	)
          SCREAMING_SNAKE_CASE_	=      torch.nn.Linear(config.hidden_size ,     config.hidden_size	)



       def     _UpperCamelCase	(							self ,     _A	)				->				Optional[int]:
          return self.linear(_A	)




       def     _UpperCamelCase	(							self ,     _A	)				->				int:
          pass







class 				UpperCamelCase__		(	__SCREAMING_SNAKE_CASE	):






       """simple docstring"""


       UpperCAmelCase_				       =NoSuperInitConfig



       def __init__(							self ,     _A	)				->				Optional[int]:
          super().__init__(_A	)
          SCREAMING_SNAKE_CASE_	=      torch.nn.Linear(config.attribute ,     config.attribute	)



       def     _UpperCamelCase	(							self ,     _A	)				->				Any:
          return self.linear(_A	)




       def     _UpperCamelCase	(							self ,     _A	)				->				Tuple:
          pass


