code: 
  
  from typing import TYPE_CHECKING
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      _LazyModule,
      is_tf_available,
      is_torch_available,
      is_vision_available,
  )
  
  
  A_		:			Optional[int]										=   {
      'configuration_segformer': ['SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'SegformerConfig', 'SegformerOnnxConfig']
  }
  
  try:
         if not is_vision_available():
                raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
         pass
  else:
         A_		:			Any										=   ['SegformerFeatureExtractor']
         A_		:			Union[str, Any]										=   ['SegformerImageProcessor']
  
  try:
         if not is_torch_available():
                raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
         pass
  else:
         A_		:			List[Any]										=   [
             'SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
             'SegformerDecodeHead',
             'SegformerForImageClassification',
             'SegformerForSemanticSegmentation',
             'SegformerLayer',
             'SegformerModel',
             'SegformerPreTrainedModel',
         ]
  
  try:
         if not is_tf_available():
                raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
         pass
  else:
         A_		:			int										=   [
             'TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
             'TFSegformerDecodeHead',
             'TFSegformerForImageClassification',
             'TFSegformerForSemanticSegmentation',
             'TFSegformerModel',
             'TFSegformerPreTrainedModel',
         ]
  
  
  if TYPE_CHECKING:
         from .configuration_segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig, SegformerOnnxConfig
  
         try:
                if not is_vision_available():
                       raise OptionalDependencyNotAvailable()
         except OptionalDependencyNotAvailable:
                pass
         else:
                from .feature_extraction_segformer import SegformerFeatureExtractor
                from .image_processing_segformer import SegformerImageProcessor
  
         try:
                if not is_torch_available():
                       raise OptionalDependencyNotAvailable()
         except OptionalDependencyNotAvailable:
                pass
         else:
                from .modeling_segformer import (
                    SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                    SegformerDecodeHead,
                    SegformerForImageClassification,
                    SegformerForSemanticSegmentation,
                    SegformerLayer,
                    SegformerModel,
                    SegformerPreTrainedModel,
                )
         try:
                if not is_tf_available():
                       raise OptionalDependencyNotAvailable()
         except OptionalDependencyNotAvailable:
                pass
         else:
                from .modeling_tf_segformer import (
                    TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                    TFSegformerDecodeHead,
                    TFSegformerForImageClassification,
                    TFSegformerForSemanticSegmentation,
                    TFSegformerModel,
                    TFSegformerPreTrainedModel,
                )
  
  else:
         import sys
  
         A_		:			List[str]										=   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
  
  
  
  
style_context: 
  
  import numpy as np
  
  
  def       __a       (   SCREAMING_SNAKE_CASE      )      ->     Tuple:
  
  
  
  
  
  
      '''simple docstring'''
      __UpperCAmelCase					,     __UpperCAmelCase									=			a.shape
      __UpperCAmelCase									=			min(SCREAMING_SNAKE_CASE       ,   SCREAMING_SNAKE_CASE      )
      __UpperCAmelCase									=			np.eye(SCREAMING_SNAKE_CASE      )
      __UpperCAmelCase									=			a.copy()
  
      for k in range(t - 1      ):
          # select a column of modified matrix A':
          __UpperCAmelCase									=			r[k:, [k]]
          # construct first basis vector
          __UpperCAmelCase									=			np.zeros_like(SCREAMING_SNAKE_CASE      )
          __UpperCAmelCase									=			1.0
          # determine scaling factor
          __UpperCAmelCase									=			np.linalg.norm(SCREAMING_SNAKE_CASE      )
          # construct vector v for Householder reflection
          __UpperCAmelCase									=			x + np.sign(x[0]      ) * alpha * ea
          v /= np.linalg.norm(SCREAMING_SNAKE_CASE      )
  
          # construct the Householder matrix
          __UpperCAmelCase									=			np.eye(m - k      ) - 2.0 * v @ v.T
          # pad with ones and zeros as necessary
          __UpperCAmelCase									=			np.block([[np.eye(SCREAMING_SNAKE_CASE      ), np.zeros((k, m - k)      )], [np.zeros((m - k, k)      ), q_k]]      )
  
          __UpperCAmelCase									=			q @ q_k.T
          __UpperCAmelCase									=			q_k @ r
  
      return q, r
  
  
  if __name__ == "__main__":
         import doctest
  
         doctest.testmod()
  
  
  
  
  