code: def _validate_and_update_main_output_types(self, prog):
      assert isinstance(self.main_output_types, list)
      assert len(self.main_output_types) > 0
      output_vars = prog.functions["main"].outputs
      output_vars_names = set([var.name for var in output_vars])
  
      # validation
      if get_output_names(self.main_output_types) is None:
          # this is the case, where the user did not provide names for the outputs.
          # In this case, the outputs were inferred from the TF graph automatically.
          # There are two scenarios here: number of inferred outputs equal to 1 or greater than 1
          if len(output_vars) == 1:
              if len(self.main_output_types) > 1:
                  msg = (
                      "The list of ct.TensorType()/ct.ImageType() provided in the 'outputs' argument, does not "
                      "have names. When more than 1 output is provided for tensorflow conversion, "
                      "each entry in the outputs list must have the name specified as well, "
                      "via the 'name' argument in ct.TensorType/ct.ImageType"
                  )
                  raise ValueError(msg)
          else:  # len(output_vars) > 1
              # if there are more than 1 sink nodes (i.e. inferred outputs), the user must provide names
              # so that the output types can be correctly mapped.
              msg = (
                  "The list of ct.TensorType()/ct.ImageType() provided in the 'outputs' argument, does not "
                  "have names. When names are not provided, the outputs are automatically inferred "
                  "from the TF graph. There are {} outputs detected which are more than 1. "
                  "In this case, to map the output types correctly, "
                  "please provide names for each of the "
                  "outputs. The output names inferred from the TF graph are: {} "
              )
              raise ValueError(
                  msg.format(
                      len(output_vars),
                      output_vars_names,
                  )
              )
      else:
          # user provided output names. In this case, the appropriate tensors must have
          # been selected from the TF graph bases on the output names.
          # Verify that the names present in self.main_output_types match the output_vars_names (it should match).
          # Also, reconstruct the self.main_output_types list, in the same order of outputs as
          # present in the output_vars_names
          assert len(output_vars) == len(
              self.main_output_types
          ), "this should match if the outputs were picked correctly from the TF graph"
          for out in self.main_output_types:
              if out.name not in output_vars_names:
                  msg = "output name, '{}', not found in Tensorflow Graph. Available output names are: {}"
                  raise KeyError(
                      msg.format(out.name, output_vars_names)
                  )
          name_to_output_type_map = {}
          for out in self.main_output_types:
              name_to_output_type_map[out.name] = out
          main_output_types = []
          for out_var in output_vars:
              main_output_types.append(
                  name_to_output_type_map[out_var.name]
              )
          self.main_output_types = main_output_types
  
imports: from coremltools import _logger
  from coremltools.converters._profile_utils import _profile
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.input_types import ImageType, InputType, RangeDim
  from coremltools.converters.mil.input_types import Shape
  from coremltools.converters.mil.input_types import TensorType, _get_shaping_class
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, Program, get_new_symbol, types
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
  from coremltools.converters.mil.mil.var import Var
  from .._utils import get_output_names
  from .basic_graph_ops import simple_topsort
  from .convert_utils import convert_graph
label_desc: Use image node_id 6 for calling the TFConverter obj's underlying member method code with example usage: obj._validate_and_update_main_output_types(prog) without return types