code: def save_to_file(
      inp_dict,
      out_filepath,
      out_format="json",
      runtime_features=None,
      profiler="native",
  ):
      """Saves the given input dictionary to the given output file.
  
      By default, saves the input dictionary as JSON file. Other supported formats include:
      1. md
  
      Parameters
      ----------
      inp_dict: map
          Input dictionary to be saved
      out_filepath: str
          Output file path
      out_format: str, default 'json'
          Format of the output file. Supported options - 'json', 'md'. Default - json.
      runtime_features: map
          Dictionary of runtime_features.
  
      """
      if out_format == "json":
          # Save as JSON
          with open(out_filepath, "w") as result_file:
              json.dump(
                  inp_dict, result_file, indent=4, sort_keys=False
              )
      elif out_format == "md":
          # Save as md
          with open(out_filepath, "w") as result_file:
              result_file.write(
                  _prepare_markdown(
                      inp_dict, runtime_features, profiler
                  )
              )
      else:
          raise ValueError(
              f"Invalid output file format provided - '{out_format}'. Supported - json, md"
          )
  
file_path: mxnet/benchmark/opperf/utils/common_utils.py
imports: import os
  import json
  from operator import itemgetter
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: save_to_file(inp_dict, out_filepath, out_format, runtime_features, profiler) without return types