Utils

Analysis, Parsing

onnxcustom.utils.nvprof2json.convert_trace_to_json (filename, output = None, temporary_file = None, verbose = 0, fLOG = None)

Converts traces produced by nvprof and saved with format sqlite3 (extension .sql). The output format follows Trace Event Format.

onnxcustom.utils.nvprof2json.json_to_dataframe (js)

Converts a json dump obtained with function convert_trace_to_json to a dataframe.

onnxcustom.utils.nvprof2json.json_to_dataframe_streaming (js, chunksize = 100000, flatten = False, kwargs)

Converts a big json dump (from convert_trace_to_json) to a dataframe. The function processes the data by streaming to avoid loading huge data in memory. Returns an iterator on dataframes. The function relies on pandas_streaming.

Labelling

onnxcustom.utils.imagenet_classes.get_class_names ()

Returns the class names for the ImageNet competition as a dictionary.

Time

onnxcustom.utils.measure_time (stmt, context, repeat = 10, number = 50, div_by_number = False)

Measures a statement and returns the results as a dictionary.

Debugging

onnxcustom.utils.str_ortvalue (ov)

Displays the content of an C_OrtValue.