class_docstr: Class containing tests for InternalTorchIR optimization passes.
      
class_docstr_tok: ["Class","containing","tests","for","InternalTorchIR","optimization","passes","."]
code: def test_flatten_input_values(self):
      graph = _build_flattening_test_graph()
  
      flatten_graph_input_values(graph)
  
      # The graph input tuple should have been flattened.
      np.testing.assert_equal(len(graph.inputs.keys()), 3)
      # Tuple flattening should introduce two new ops.
      np.testing.assert_equal(len(graph.nodes), 6)
      # The new ops at the beginning of the graph should be a tupleconstruct.
      np.testing.assert_equal(graph.nodes[0].kind, "tupleconstruct")
      np.testing.assert_equal(graph.nodes[1].kind, "tupleconstruct")
      # The inputs to the tupleconstructs should be the new flattened inputs.
      input_names = [k for k in graph.inputs.keys()]
      np.testing.assert_equal(input_names[1:], graph.nodes[0].inputs)
      np.testing.assert_equal(input_names[0], graph.nodes[1].inputs[0])
      np.testing.assert_equal(
          graph.nodes[0].outputs[0], graph.nodes[1].inputs[1]
      )
      # The last inserted tuple construct should produce the input for the
      # next op.
      np.testing.assert_equal(
          graph.nodes[1].outputs[0], graph.nodes[2].inputs[0]
      )
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/torch/test/test_passes.py
imports: import itertools
  import numpy
  import pytest
  import torch
  from ..internal_graph import *
  from ..torchir_passes import *
label_desc: Use image node_id 2 for calling the TestTorchPasses obj's underlying member method code with example usage: obj.test_flatten_input_values() without return types