class_docstr: Abstract class for TensorFlow model loader.
class_docstr_tok: ["Abstract","class","for","TensorFlow","model","loader","."]
docstr: Extract sub-graph based on user-provided outputs.
docstr_tok: ["Extract","sub-graph","based","on","user-provided","outputs","."]
code: def extract_sub_graph(graph_def, outputs=None):
      """Extract sub-graph based on user-provided outputs."""
      if outputs is None or len(outputs) == 0:
          return graph_def
      msg = "Extracting sub-graph based on outputs '{}' from the full model"
      logging.debug(msg.format(outputs))
      outputs = outputs if isinstance(outputs, list) else [outputs]
      outputs = [i.split(":")[0] for i in outputs]
      if tf.__version__ < _StrictVersion("1.13.1"):
          return tf.graph_util.extract_sub_graph(graph_def, outputs)
      else:
          return tf.compat.v1.graph_util.extract_sub_graph(
              graph_def, outputs
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import os
  import gc
  import six
  import tensorflow
  from tempfile import mktemp
  from .basic_graph_ops import fill_outputs
  from .converter import TFConverter
  from .tf_graph_pass import *
  from .tfssa import NetworkEnsemble, SSAFunction
  from .parsed_tf_node import ParsedTFNode
  from coremltools.converters._profile_utils import _profile
  from tqdm import tqdm
  from distutils.version import StrictVersion
label_desc: Use image node_id 6 for calling the TFLoader obj's underlying member method code with example usage: obj.extract_sub_graph(graph_def, outputs) and returns: graph_def, tf, tf