code: def graph(graph_def, max_const_size=32):
      """Visualize a TensorFlow graph.
  
      This function was originally found in this notebook (also Apache licensed):
      https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/deepdream/deepdream.ipynb
      """
      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>
            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: none;" srcdoc="{}"></iframe>
      """.format(
          code.replace('"', "&quot;")
      )
      _display_html(iframe)
  
file_path: lucid/lucid/misc/io/showing.py
imports: from __future__ import absolute_import, division, print_function
  from io import BytesIO
  import base64
  import logging
  import numpy
  import IPython.display
  from string import Template
  import tensorflow
  from lucid.misc.io.serialize_array import serialize_array, array_to_jsbuffer
  from lucid.misc.io.collapse_channels import collapse_channels
label_desc: Use image node_id 9 for calling a global function with example usage: graph(graph_def, max_const_size) without return types