(graph_def, max_const_size=32)
Visualize TensorFlow graph.

    Taken from
    http://stackoverflow.com/questions/38189119/simple-way-to-visualize-a-
    tensorflow-graph-in-jupyter
Visualize TensorFlow graph.
Visualize TensorFlow graph .
def show_graph(graph_def, max_const_size=32):
    """Visualize TensorFlow graph.

    Taken from
    http://stackoverflow.com/questions/38189119/simple-way-to-visualize-a-
    tensorflow-graph-in-jupyter
    """
    if hasattr(graph_def, 'as_graph_def'):
        graph_def = graph_def.as_graph_def()
    strip_def = strip_consts(graph_def, max_const_size=max_const_size)
    code = """
        <script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.3.3/platform.js"></script>
        <script>
          function load() {{
            document.getElementById("{id}").pbtxt = {data};
          }}
        </script>
        <link rel="import" href="https://tensorboard.appspot.com/tf-graph-basic.build.html" onload=load()>
        <div style="height:600px">
          <tf-graph-basic id="{id}"></tf-graph-basic>
        </div>
    """.format(data=repr(str(strip_def)),
               id='graph'+str(np.random.rand()))

    iframe = """
        <iframe seamless style="width:100%;height:620px;border:0" srcdoc="{}"></iframe>
    """.format(code.replace('"', '&quot;'))
    display(HTML(iframe))
def show_graph ( graph_def , max_const_size = 32 ) : if hasattr ( graph_def , 'as_graph_def' ) : graph_def = graph_def . as_graph_def ( ) strip_def = strip_consts ( graph_def , max_const_size = max_const_size ) code = """
        <script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.3.3/platform.js"></script>
        <script>
          function load() {{
            document.getElementById("{id}").pbtxt = {data};
          }}
        </script>
        <link rel="import" href="https://tensorboard.appspot.com/tf-graph-basic.build.html" onload=load()>
        <div style="height:600px">
          <tf-graph-basic id="{id}"></tf-graph-basic>
        </div>
    """ . format ( data = repr ( str ( strip_def ) ) , id = 'graph' + str ( np . random . rand ( ) ) ) iframe = """
        <iframe seamless style="width:100%;height:620px;border:0" srcdoc="{}"></iframe>
    """ . format ( code . replace ( '"' , '&quot;' ) ) display ( HTML ( iframe ) )