Skip to content

Instantly share code, notes, and snippets.

View live-wire's full-sized avatar

Dhruv Batheja live-wire

View GitHub Profile
from graphviz import Digraph
import torch
from torch.autograd import Variable, Function
def iter_graph(root, callback):
queue = [root]
seen = set()
while queue:
fn = queue.pop()
if fn in seen: