def _dump_trace(trace_name, name, suffix, complete_trace): if not _dump_traces: return filename = "{}_{}_{}".format(trace_name, name, suffix) with open(filename + ".ir", "w") as f: f.write(str(complete_trace)) graph_vis.write(complete_trace.graph(), filename + ".html")
def _dump_trace(trace_name, pass_name, input_key, trace): if not _JIT_DUMP: return import torch.contrib._graph_vis as graph_vis filename = "{}_{}".format(trace_name, pass_name) # TODO: Also paste out the backtrace when the trace was compiled # (and maybe also when it was run?) with open(filename + ".ir", "w") as f: f.write("Input key: {}\n\n{}".format(input_key, str(trace))) graph_vis.write(trace.graph(), filename + ".html")