docstr: Overwrites TFLoader._graph_def_from_model()
docstr_tok: ["Overwrites","TFLoader._graph_def_from_model","(",")"]
code: def _graph_def_from_model(self, outputs=None):
      """Overwrites TFLoader._graph_def_from_model()"""
      msg = (
          "Expected model format: [SavedModel | [concrete_function] | "
          "tf.keras.Model | .h5], got {}"
      )
      if (
          isinstance(self.model, list)
          or isinstance(self.model, _tf.keras.Model)
          or isinstance(self.model, _string_types)
      ):
          cfs = []
          if isinstance(self.model, list):
              cfs = self.model
          if isinstance(self.model, _tf.keras.Model):
              cfs = self._concrete_fn_from_tf_keras_or_h5(self.model)
          elif isinstance(self.model, _string_types):
              if not _os_path.exists(self.model):
                  raise ValueError(
                      'Input model "{}" does not exist'.format(
                          self.model
                      )
                  )
              elif _os_path.isfile(self.model) and self.model.endswith(
                  ".h5"
              ):
                  cfs = self._concrete_fn_from_tf_keras_or_h5(
                      self.model
                  )
              elif _os_path.isdir(self.model):
                  saved_model = _tf.saved_model.load(self.model)
                  sv = saved_model.signatures.values()
                  cfs = sv if isinstance(sv, list) else list(sv)
              else:
                  raise NotImplementedError(msg.format(self.model))
  
          graph_def = self._graph_def_from_concrete_fn(cfs)
          return self.extract_sub_graph(graph_def, outputs)
      else:
          raise NotImplementedError(msg.format(self.model))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import os.path
  from six import string_types
  from tqdm import tqdm
  import tensorflow
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2
  from tensorflow.python.framework.function_def_to_graph import function_def_to_graph
  from tensorflow.python.keras.saving import saving_utils
  from tensorflow.lite.python.util import run_graph_optimizations
  from tensorflow.lite.python.util import get_grappler_config
  from .converter import TF2Converter
  from coremltools.converters.mil.frontend.tensorflow.basic_graph_ops import fill_outputs
  from coremltools.converters.mil.frontend.tensorflow.tf_graph_pass import constant_propagation, remove_variable_nodes, tensor_array_resource_removal, insert_get_tuple, delete_disconnected_nodes, fuse_dilation_conv
  from coremltools.converters.mil.frontend.tensorflow2.tf_graph_pass import flatten_sub_graph_namespaces, rewrite_control_flow_functions
  from coremltools.converters.mil.frontend.tensorflow.tfssa import NetworkEnsemble, SSAFunction
  from coremltools.converters.mil.frontend.tensorflow.parsed_tf_node import ParsedTFNode
  from coremltools.converters.mil.frontend.tensorflow.load import TFLoader
label_desc: Use image node_id 2 for calling the TF2Loader obj's underlying member method code with example usage: obj._graph_def_from_model(outputs) and returns: self