code: def _build_flattening_test_graph():
      # This test graph is:
      #    graph(
      #        %1 : (Tensor[1, 1], (Tensor[1, 2], Tensor[1, 3]))
      #    ):
      #    %2, %3 = tupleunpack[](%1)
      #    %4, %5 = tupleunpack[](%3)
      #    %6 = tupleconstruct[](%2, %4)
      #    %7 = tupleconstruct[](%6, %5)
      #    return (%7)
      #
      # And if you were to run the graph it would turn
      #    (a, (b, c))
      # into
      #    ((a, b), c)
  
      graph_params = {}
      graph_inputs = OrderedDict()
      graph_inputs["1"] = (
          torch.rand(1, 1),
          (
              torch.rand(1, 2),
              torch.rand(1, 3),
          ),
      )
      graph_nodes = [
          InternalTorchIRNode(
              inputs=["1"],
              outputs=["2", "3"],
              kind="tupleunpack",
          ),
          InternalTorchIRNode(
              inputs=["3"],
              outputs=["4", "5"],
              kind="tupleunpack",
          ),
          InternalTorchIRNode(
              inputs=["2", "4"],
              outputs=["6"],
              kind="tupleconstruct",
          ),
          InternalTorchIRNode(
              inputs=["6", "5"],
              outputs=["7"],
              kind="tupleconstruct",
          ),
      ]
      graph_outputs = ["7"]
  
      return InternalTorchIRGraph(
          nodes=graph_nodes,
          params=graph_params,
          inputs=graph_inputs,
          outputs=graph_outputs,
      )
  
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 1 for calling a global function with example usage: _build_flattening_test_graph() and returns: InternalTorchIRGraph