

from __future__ import annotations

import numpy as np
from numpy import floataa
from numpy.typing import NDArray
def     UpperCAmelCase_       (						_A				,		_A				,		_A				,		_A				,		):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   coefficient_matrix.shape
     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   constant_matrix.shape

     if rowsa != colsa:
          SCREAMING_SNAKE_CASE__   =   F'''Coefficient matrix dimensions must be nxn but received {rowsa}x{colsa}'''
          raise ValueError(UpperCAmelCase__    )

     if colsa != 1:
          SCREAMING_SNAKE_CASE__   =   F'''Constant matrix must be nx1 but received {rowsa}x{colsa}'''
          raise ValueError(UpperCAmelCase__    )

     if rowsa != rowsa:
          SCREAMING_SNAKE_CASE__   =   (
              '''Coefficient and constant matrices dimensions must be nxn and nx1 but '''
              F'''received {rowsa}x{colsa} and {rowsa}x{colsa}'''
          )
          raise ValueError(UpperCAmelCase__    )

     if len(UpperCAmelCase__    ) != rowsa:
          SCREAMING_SNAKE_CASE__   =   (
              '''Number of initial values must be equal to number of rows in coefficient '''
              F'''matrix but received {len(UpperCAmelCase__    )} and {rowsa}'''
          )
          raise ValueError(UpperCAmelCase__    )

     if iterations <= 0:
          raise ValueError('''Iterations must be at least 1'''    )

     SCREAMING_SNAKE_CASE__   =   np.concatenate(
         (coefficient_matrix, constant_matrix)				,		axis=1    )

     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   table.shape

     strictly_diagonally_dominant(UpperCAmelCase__    )

     # Iterates the whole matrix for given number of times
     for _ in range(UpperCAmelCase__    ):
          SCREAMING_SNAKE_CASE__   =   []
          for row in range(UpperCAmelCase__    ):
               SCREAMING_SNAKE_CASE__   =   0
               for col in range(UpperCAmelCase__    ):
                    if col == row:
                         SCREAMING_SNAKE_CASE__   =   table[row][col]
                    elif col == cols - 1:
                         SCREAMING_SNAKE_CASE__   =   table[row][col]
                    else:
                         temp += (-1) * table[row][col] * init_val[col]
               SCREAMING_SNAKE_CASE__   =   (temp + val) / denom
               new_val.append(UpperCAmelCase__    )
          SCREAMING_SNAKE_CASE__   =   new_val

     return [float(UpperCAmelCase__    ) for i in new_val]
def     UpperCAmelCase_       (						_A    ):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   table.shape

     SCREAMING_SNAKE_CASE__   =   True

     for i in range(0				,		UpperCAmelCase__    ):
          SCREAMING_SNAKE_CASE__   =   0
          for j in range(0				,		cols - 1    ):
               if i == j:
                    continue
               else:
                    total += table[i][j]

          if table[i][i] <= total:
               raise ValueError('''Coefficient matrix is not strictly diagonally dominant'''    )

     return is_diagonally_dominant


# Test Cases
if __name__ == "__main__":
   import doctest

   doctest.testmod()





from ...configuration_utils import PretrainedConfig
from ...utils import logging


_SCREAMING_SNAKE_CASE					:  Any             =      logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE					:  Optional[Any]             =      {
    '''google/vivit-b-16x2-kinetics400''': (
        '''https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json'''
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}






class 	UpperCAmelCase__		(	A__	):






  """simple docstring"""


  a									= "vivit"






  def __init__(							self						:		str     ,       __lowerCamelCase						:		List[Any]=224     ,       __lowerCamelCase						:		Optional[int]=32     ,       __lowerCamelCase						:		Tuple=[2, 16, 16]     ,       __lowerCamelCase						:		Union[str, Any]=3     ,       __lowerCamelCase						:		Optional[Any]=768     ,       __lowerCamelCase						:		Any=12     ,       __lowerCamelCase						:		Optional[Any]=12     ,       __lowerCamelCase						:		List[str]=3072     ,       __lowerCamelCase						:		Any="gelu_fast"     ,       __lowerCamelCase						:		Union[str, Any]=0.0     ,       __lowerCamelCase						:		int=0.0     ,       __lowerCamelCase						:		str=0.02     ,       __lowerCamelCase						:		Any=1e-06     ,       __lowerCamelCase						:		Dict=True     ,       **__lowerCamelCase						:		Any     ,       )		->							List[str]:
       SCREAMING_SNAKE_CASE__   =   hidden_size
       SCREAMING_SNAKE_CASE__   =   num_hidden_layers
       SCREAMING_SNAKE_CASE__   =   num_attention_heads
       SCREAMING_SNAKE_CASE__   =   intermediate_size
       SCREAMING_SNAKE_CASE__   =   hidden_act
       SCREAMING_SNAKE_CASE__   =   hidden_dropout_prob
       SCREAMING_SNAKE_CASE__   =   attention_probs_dropout_prob
       SCREAMING_SNAKE_CASE__   =   initializer_range
       SCREAMING_SNAKE_CASE__   =   layer_norm_eps

       SCREAMING_SNAKE_CASE__   =   image_size
       SCREAMING_SNAKE_CASE__   =   num_frames
       SCREAMING_SNAKE_CASE__   =   tubelet_size
       SCREAMING_SNAKE_CASE__   =   num_channels
       SCREAMING_SNAKE_CASE__   =   qkv_bias

       super().__init__(**__lowerCamelCase )


