parameters: (onnx_model_path, graph_config, dense_model, convert_embedding = False, sparse_models = None, ntp_file = None, graph_name = "hugectr")
docstring: Convert a HugeCTR model to an ONNX model
      Args:
          onnx_model_path: the path to store the ONNX model
          graph_config: the graph configuration JSON file of the HugeCTR model
          dense_model: the file of the dense weights for the HugeCTR model
          convert_embedding: whether to convert the sparse embeddings for the HugeCTR model (optional)
          sparse_models: the files of the sparse embeddings for the HugeCTR model (optional)
          ntp_file: the file of the non-trainable parameters for the HugeCTR model (optional)
          graph_name: the graph name for the ONNX model (optional)
docstring_summary: Convert a HugeCTR model to an ONNX model
      Args:
          onnx_model_path: the path to store the ONNX model
          graph_config: the graph configuration JSON file of the HugeCTR model
          dense_model: the file of the dense weights for the HugeCTR model
          convert_embedding: whether to convert the sparse embeddings for the HugeCTR model (optional)
          sparse_models: the files of the sparse embeddings for the HugeCTR model (optional)
          ntp_file: the file of the non-trainable parameters for the HugeCTR model (optional)
          graph_name: the graph name for the ONNX model (optional)
docstring_tokens: Convert a HugeCTR model to an ONNX model Args : onnx_model_path : the path to store the ONNX model graph_config : the graph configuration JSON file of the HugeCTR model dense_model : the file of the dense weights for the HugeCTR model convert_embedding : whether to convert the sparse embeddings for the HugeCTR model ( optional ) sparse_models : the files of the sparse embeddings for the HugeCTR model ( optional ) ntp_file : the file of the non - trainable parameters for the HugeCTR model ( optional ) graph_name : the graph name for the ONNX model ( optional )
function: def convert(onnx_model_path, graph_config, dense_model, convert_embedding = False, sparse_models = None, ntp_file = None, graph_name = "hugectr"):
      """Convert a HugeCTR model to an ONNX model
      Args:
          onnx_model_path: the path to store the ONNX model
          graph_config: the graph configuration JSON file of the HugeCTR model
          dense_model: the file of the dense weights for the HugeCTR model
          convert_embedding: whether to convert the sparse embeddings for the HugeCTR model (optional)
          sparse_models: the files of the sparse embeddings for the HugeCTR model (optional)
          ntp_file: the file of the non-trainable parameters for the HugeCTR model (optional)
          graph_name: the graph name for the ONNX model (optional)
      """    
      loader = HugeCTRLoader(graph_config, dense_model, convert_embedding, sparse_models, ntp_file)
      builder = GraphBuilder(convert_embedding)
      for _ in range(loader.layers):
          layer_params, weights_dict, dimensions = loader.load_layer()
          builder.add_layer(layer_params, weights_dict, dimensions)
      builder.create_graph(graph_name)
      builder.save_model(onnx_model_path)
function_tokens: def convert ( onnx_model_path , graph_config , dense_model , convert_embedding = False , sparse_models = None , ntp_file = None , graph_name = "hugectr" ) : loader = HugeCTRLoader ( graph_config , dense_model , convert_embedding , sparse_models , ntp_file ) builder = GraphBuilder ( convert_embedding ) for _ in range ( loader . layers ) : layer_params , weights_dict , dimensions = loader . load_layer ( ) builder . add_layer ( layer_params , weights_dict , dimensions ) builder . create_graph ( graph_name ) builder . save_model ( onnx_model_path )