Convert torch._C.Graph to torch.jit.Graph

Is there any way to convert torch._C.Graph to torch.jit.Graph. Or is there a way generate a dot file from the torch._C.Graph. I would like to create a dot file from tracing like in make_dot_from_trace function. But it takes only torch.jit.Graph as input.

When I ran my model through torch.jit.trace(model, input); I got a object whose .graph was of type torch._C.Graph which throws error when I keep it as a parameter for. make_dot_from_trace function.

Hi so we don’t have a torch.jit.Graph object to begin with I think, all graph objects are torch._C.Graph, so I think if pytorchviz is using torch.jit.Graph that could be already a issue, you probably should submit a issue or a fix to the pytorchviz repo instead.