class_docstr: Graph Def summary 
class_docstr_tok: ["Graph","Def","summary"]
code: def Summary(self):
      placeholders = []
      variables = []
      print(
          "Graph Version: {}.{}".format(
              self.graph.versions.producer,
              self.graph.versions.min_consumer,
          )
      )
      for node in self.graph.node:
          if node.op == "Placeholder":
              placeholders.append(node)
          if node.op == "Variable" or node.op == "VariableV2":
              variables.append(node)
      if len(placeholders) == 0:
          print("No inputs spotted")
      else:
          print("Found {} possible inputs: ".format(len(placeholders)))
          self.summray_dict["inputs"] = []
          for node in placeholders:
              in_info = self.PrintNodeInfo(node)
              self.summray_dict["inputs"].append(in_info)
      if len(variables) == 0:
          pass
          print("No variables spotted")
      else:
          print("Found {} variables".format(len(variables)))
          self.summray_dict["variables"] = []
          for node in variables:
              var_info = self.PrintNodeInfo(node)
              self.summray_dict["variables"].append(var_info)
  
      output_map = {}
      self.MapNodesToOutputs(output_map)
      outputs = []
      unlikely_output_types = [
          "Const",
          "Assign",
          "NoOp",
          "Placeholder",
          "VarIsInitializedOp",
      ]
      for node in self.graph.node:
          if (node.name not in output_map) and (
              node.op not in unlikely_output_types
          ):
              outputs.append(node)
      if len(outputs) == 0:
          print("No outputs spotted")
      else:
          print("Found {} possible outputs:".format(len(outputs)))
          self.summray_dict["outputs"] = []
          for node in outputs:
              print(
                  "    ===>> (name={}, op={})".format(
                      node.name, node.op
                  )
              )
              self.summray_dict["outputs"].append(node.name)
  
      const_parameter_count = 0
      variable_parameter_count = 0
      control_edge_count = 0
      device_counts = {}
      for node in self.graph.node:
          for input in node.input:
              if input[0] == "^":
                  control_edge_count += 1
          if len(node.device) != 0:
              device_counts[node.device] = (
                  0
                  if node.device not in device_counts
                  else device_counts[node.device] + 1
              )
          if node.op in ["Const", "Variable", "VariableV2"]:
              if "value" in node.attr:
                  tensor = tf.io.parse_tensor(
                      node.attr["value"].tensor.SerializeToString(),
                      tf.DType(node.attr["value"].tensor.dtype),
                  )
                  num_elements = tensor.shape.num_elements()
                  if node.op == "Const":
                      const_parameter_count += (
                          num_elements
                          if num_elements is not None
                          else 0
                      )
                  else:
                      variable_parameter_count += num_elements
      self.summray_dict["const_parameter_count"] = const_parameter_count
      self.summray_dict[
          "variable_parameter_count"
      ] = variable_parameter_count
      self.summray_dict["control_edge_count"] = control_edge_count
      print(
          "Found {} const parameters, {} variable parameters, and {} control_edges".format(
              const_parameter_count,
              variable_parameter_count,
              control_edge_count,
          )
      )
      if len(device_counts.keys()) != 0:
          str_dev_info = ""
          for device_info in device_counts:
              str_dev_info += "%s nodes assigned to device %s, " % (
                  str(device_info.second),
                  str(device_info.first),
              )
          print(str_dev_info)
  
file_path: delta/gcompiler/python/delta_infer/subgraphs/common/summarize_graph.py
imports: from __future__ import absolute_import, division, print_function
  import tensorflow
  import os
  import sys
  import numpy
  from tensorflow.compat.v1 import GraphDef
label_desc: Use image node_id 7 for calling the GraphSummary obj's underlying member method code with example usage: obj.Summary() without return types