def draw_to_notebook(layers, **kwargs):
 from IPython.display import Image
 layers = (layers.get_all_layers() if hasattr(layers, 'get_all_layers') else layers)
 dot = make_pydot_graph(layers, **kwargs)
 return Image(dot.create_png())

def draw_to_notebook ( layers , ** kwargs ) : from IPython . display import Image layers = ( layers . get_all_layers ( ) if hasattr ( layers , 'get_all_layers' ) else layers ) dot = make_pydot_graph ( layers , ** kwargs ) return Image ( dot . create_png ( ) )
draws a network diagram in an ipython notebook .