docstr: Eliminate invalid input/output nodes in the given list. Should only be
  invoked if the self.inputs and self.outputs are both provided and we
  want to respect those when adding SSAFunctions. Only needed for TF2 for
  now because of the needs to parse multiple functions in graph. TF1 only
  has one "main" function.
docstr_tok: ["Eliminate","invalid","input\/output","nodes","in","the","given","list",".","Should","only","be","invoked","if","the","self.inputs","and","self.outputs","are","both","provided","and","we","want","to","respect","those","when","adding","SSAFunctions",".","Only","needed","for","TF2","for","now","because","of","the","needs","to","parse","multiple","functions","in","graph",".","TF1","only","has","one","``","main","''","function","."]
code: def filter_inputs_and_outputs(self):
      """
      Eliminate invalid input/output nodes in the given list. Should only be
      invoked if the self.inputs and self.outputs are both provided and we
      want to respect those when adding SSAFunctions. Only needed for TF2 for
      now because of the needs to parse multiple functions in graph. TF1 only
      has one "main" function.
      """
      filtered_inputs = []
      filtered_outputs = []
      for k in self.inputs:
          if k not in self.graph.keys():
              continue
          v = self.graph[k]
          if len(v.inputs) == 0 and v.op not in {
              "Const",
              "get_global",
              "NoOp",
          }:
              filtered_inputs.append(k)
              self.input_types.append(v.datatype)
          elif len(v.inputs) != 0 and v.op == "Placeholder":
              assert (
                  len(v.inputs) == 1
              ), "This is not a PlaceholderWithDefault!"
              filtered_inputs.append(k)
              self.input_types.append(v.datatype)
      for k in self.outputs:
          if k not in self.graph.keys():
              continue
          v = self.graph[k]
          filtered_outputs.append(k)
          self.output_types.append(v.datatype)
      self.inputs, self.outputs = filtered_inputs, filtered_outputs
  
imports: import copy
  from coremltools import _logger
  from coremltools.converters.mil.mil import types
  from .basic_graph_ops import check_connections, const_determined_nodes
  from .dot_visitor import DotVisitor
  from .naming_utils import escape_fn_name
label_desc: Use image node_id 3 for calling the SSAFunction obj's underlying member method code with example usage: obj.filter_inputs_and_outputs() without return types