


'''simple docstring'''






def 		_A (lowerCAmelCase__     :int ,  lowerCAmelCase__     :int						)      ->     Union[str, Any]:




     '''simple docstring'''



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






def 		_A (lowerCAmelCase__     :Optional[Any] ,  lowerCAmelCase__     :Tuple						)      ->     int:




     '''simple docstring'''



     _a						=							[[float('inf'						) for _ in range(__UpperCAmelCase						)] for _ in range(__UpperCAmelCase						)]

     for i in range(__UpperCAmelCase						):
          for j in range(__UpperCAmelCase						):
               _a						=							graph[i][j]

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

     _print_dist(__UpperCAmelCase ,  __UpperCAmelCase						)
     return dist, v


if __name__ == "__main__":
 a_    :			Optional[Any]      				=			int(input("Enter number of vertices: "))
 a_    :			str      				=			int(input("Enter number of edges: "))

 a_    :			Optional[int]      				=			[[float("inf") for i in range(v)] for j in range(v)]

 for i in range(v):
  a_    :			Tuple      				=			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)
  a_    :			Optional[Any]      				=			int(input("Enter source:"))
  a_    :			Union[str, Any]      				=			int(input("Enter destination:"))
  a_    :			Any      				=			float(input("Enter weight:"))
  a_    :			Dict      				=			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

import torch

from transformers import FunnelBaseModel, FunnelConfig, FunnelModel, load_tf_weights_in_funnel
from transformers.utils import logging


logging.set_verbosity_info()



def SCREAMING_SNAKE_CASE__			(   __UpperCAmelCase       ,    __UpperCAmelCase       ,    __UpperCAmelCase       ,    __UpperCAmelCase )  ->  List[Any]:
   # Initialise PyTorch model
   lowercase__:   Optional[Any]					=      FunnelConfig.from_json_file(__UpperCAmelCase )
   print(F"""Building PyTorch model from configuration: {config}""" )
   lowercase__:   List[Any]					=      FunnelBaseModel(__UpperCAmelCase ) if base_model else FunnelModel(__UpperCAmelCase )

   # Load weights from tf checkpoint
   load_tf_weights_in_funnel(__UpperCAmelCase       ,    __UpperCAmelCase       ,    __UpperCAmelCase )

   # Save pytorch-model
   print(F"""Save PyTorch model to {pytorch_dump_path}""" )
   torch.save(model.state_dict()       ,    __UpperCAmelCase )


if __name__ == "__main__":
       __A			   = 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(
           "--config_file",
           default=None,
           type=str,
           required=True,
           help="The config json file corresponding to the pre-trained model. \nThis 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(
           "--base_model", action="store_true", help="Whether you want just the base model (no decoder) or not."
       )
       __A			   = parser.parse_args()
       convert_tf_checkpoint_to_pytorch(
           args.tf_checkpoint_path, args.config_file, args.pytorch_dump_path, args.base_model
       )
