code: def save_visualization(trace, graph_output):
      """
      DEPRECATED Use :func:`pyro.infer.inspect.render_model()` instead.
  
      Take a trace generated by poutine.trace with `graph_type='dense'`
      and render the graph with the output saved to file.
  
      - non-reparameterized stochastic nodes are salmon
      - reparameterized stochastic nodes are half salmon, half grey
      - observation nodes are green
  
      :param pyro.poutine.Trace trace: a trace to be visualized
      :param graph_output: the graph will be saved to graph_output.pdf
      :type graph_output: str
  
      Example::
  
          trace = pyro.poutine.trace(model, graph_type="dense").get_trace()
          save_visualization(trace, 'output')
      """
      warnings.warn(
          "`save_visualization` function is deprecated and will be removed in "
          "a future version."
      )
  
      import graphviz
  
      g = graphviz.Digraph()
  
      for label, node in trace.nodes.items():
          if site_is_subsample(node):
              continue
          shape = "ellipse"
          if (
              label in trace.stochastic_nodes
              and label not in trace.reparameterized_nodes
          ):
              fillcolor = "salmon"
          elif label in trace.reparameterized_nodes:
              fillcolor = "lightgrey;.5:salmon"
          elif label in trace.observation_nodes:
              fillcolor = "darkolivegreen3"
          else:
              # only visualize RVs
              continue
          g.node(
              label,
              label=label,
              shape=shape,
              style="filled",
              fillcolor=fillcolor,
          )
  
      for label1, label2 in trace.edges:
          if site_is_subsample(trace.nodes[label1]):
              continue
          if site_is_subsample(trace.nodes[label2]):
              continue
          g.edge(label1, label2)
  
      g.render(graph_output, view=False, cleanup=True)
  
imports: import functools
  import math
  import numbers
  import random
  import sys
  import timeit
  import warnings
  from collections import defaultdict
  from contextlib import contextmanager
  from itertools import zip_longest
  import numpy
  import torch
  from pyro.poutine.util import site_is_subsample
label_desc: Use image node_id 8 for calling a global function with example usage: save_visualization(trace, graph_output) without return types