



"""simple docstring"""
def   __magic_name__					(				lowercase				,      lowercase			):
   print("""\nThe shortest path matrix using Floyd Warshall algorithm\n"""			)
   for i in range(lowercase			):
      for j in range(lowercase			):
         if dist[i][j] != float("""inf"""			):
            print(int(dist[i][j]			)				,      end="""\t"""			)
         else:
            print("""INF"""				,      end="""\t"""			)
      print()





def   __magic_name__					(				lowercase				,      lowercase			):
   SCREAMING_SNAKE_CASE_:			Any        =[[float("""inf"""			) for _ in range(lowercase			)] for _ in range(lowercase			)]

   for i in range(lowercase			):
      for j in range(lowercase			):
         SCREAMING_SNAKE_CASE_:			int        =graph[i][j]

         # check vertex k against all other vertices (i, j)
   for k in range(lowercase			):
      # looping through rows of graph array
      for i in range(lowercase			):
         # looping through columns of graph array
         for j in range(lowercase			):
            if (
                dist[i][k] != float("""inf"""			)
                and dist[k][j] != float("""inf"""			)
                and dist[i][k] + dist[k][j] < dist[i][j]
            ):
               SCREAMING_SNAKE_CASE_:			int        =dist[i][k] + dist[k][j]

   _print_dist(lowercase				,      lowercase			)
   return dist, v


if __name__ == "__main__":
   _UpperCAmelCase  =      int(input("""Enter number of vertices: """))
   _UpperCAmelCase  =      int(input("""Enter number of edges: """))

   _UpperCAmelCase  =      [[float("""inf""") for i in range(v)] for j in range(v)]

   for i in range(v):
      _UpperCAmelCase  =      0.0

      # src and dst are indices that must be within the array size graph[e][v]
      # failure to follow this will result in an error
   for i in range(e):
      print("""\nEdge """, i + 1)
      _UpperCAmelCase  =      int(input("""Enter source:"""))
      _UpperCAmelCase  =      int(input("""Enter destination:"""))
      _UpperCAmelCase  =      float(input("""Enter weight:"""))
      _UpperCAmelCase  =      weight

   floyd_warshall(graph, v)

   # Example Input
   # Enter number of vertices: 3
   # Enter number of edges: 2

   # # generated graph from vertex and edge inputs
   # [[inf, inf, inf], [inf, inf, inf], [inf, inf, inf]]
   # [[0.0, inf, inf], [inf, 0.0, inf], [inf, inf, 0.0]]

   # specify source, destination and weight for edge #1
   # Edge  1
   # Enter source:1
   # Enter destination:2
   # Enter weight:2

   # specify source, destination and weight for edge #2
   # Edge  2
   # Enter source:2
   # Enter destination:1
   # Enter weight:1

   # # Expected Output from the vertice, edge and src, dst, weight inputs!!
   # 0		INF	INF
   # INF	0	2
   # INF	1	0







'''simple docstring'''


import argparse

from transformers import BigBirdConfig, BigBirdForPreTraining, BigBirdForQuestionAnswering, load_tf_weights_in_big_bird
from transformers.utils import logging


logging.set_verbosity_info()


def 		_lowercase (SCREAMING_SNAKE_CASE       ,					SCREAMING_SNAKE_CASE       ,					SCREAMING_SNAKE_CASE       ,					SCREAMING_SNAKE_CASE							):




     '''simple docstring'''





     __A	:       List[str]      =							BigBirdConfig.from_json_file(SCREAMING_SNAKE_CASE							)
     print(f"Building PyTorch model from configuration: {config}"							)

     if is_trivia_qa:
          __A	:       List[str]      =							BigBirdForQuestionAnswering(SCREAMING_SNAKE_CASE							)
     else:
          __A	:       List[Any]      =							BigBirdForPreTraining(SCREAMING_SNAKE_CASE							)

     # Load weights from tf checkpoint
     load_tf_weights_in_big_bird(SCREAMING_SNAKE_CASE       ,					SCREAMING_SNAKE_CASE       ,					is_trivia_qa=SCREAMING_SNAKE_CASE							)

     # Save pytorch-model
     print(f"Save PyTorch model to {pytorch_dump_path}"							)
     model.save_pretrained(SCREAMING_SNAKE_CASE							)


if __name__ == "__main__":
      _UpperCamelCase 							=  argparse.ArgumentParser()
      # Required parameters
      parser.add_argument(
          """--tf_checkpoint_path""", default=None, type=str, required=True, help="""Path to the TensorFlow checkpoint path."""
      )
      parser.add_argument(
          """--big_bird_config_file""",
          default=None,
          type=str,
          required=True,
          help=(
              """The config json file corresponding to the pre-trained BERT model. \n"""
              """This specifies the model architecture."""
          ),
      )
      parser.add_argument(
          """--pytorch_dump_path""", default=None, type=str, required=True, help="""Path to the output PyTorch model."""
      )
      parser.add_argument(
          """--is_trivia_qa""", action="""store_true""", help="""Whether to convert a model with a trivia_qa head."""
      )
      _UpperCamelCase 							=  parser.parse_args()
      convert_tf_checkpoint_to_pytorch(
          args.tf_checkpoint_path, args.big_bird_config_file, args.pytorch_dump_path, args.is_trivia_qa
      )

