def test_tuple_and_list_unpack(self, context, dynamic, test_tuple):
        """
            if @dynamic is True then packs up a dynamic input
            if @test_tuple is True tests tupleUnpack else tests listUnpack
        """
        if test_tuple:
            construct_op = ops.tupleconstruct
            construct_name = "TupleConstruct"
            unpack_name = "TupleUnpack"
        else:
            construct_op = ops.listconstruct
            construct_name = "ListConstruct"
            unpack_name = "ListUnpack"

        input_shape = (1, 2, 3)
        constant_vals = [str(i) for i in range(1, 6)]
        constants_unpacked = [str(i) for i in range(6, 11)]
        constants, input_list, _ = self._gen_constants(5, constant_vals)
        output_list = constants_unpacked[:]
        graph_inputs = {}
        if dynamic:
            graph_input_name = "input1"
            graph_inputs = {
                graph_input_name: mb.placeholder(input_shape, dtype=types.float)
            }
            input_list += [graph_input_name]
            output_list += [graph_input_name + "_out"]

        construct_node = InternalTorchIRNode(
            kind=construct_name, inputs=input_list, outputs=["construct"],
        )
        unpack_node = InternalTorchIRNode(
            kind=unpack_name, inputs=["construct"], outputs=output_list
        )
        with Function(inputs=graph_inputs) as ssa_func:
            if dynamic:
                context.add(ssa_func.inputs["input1"])
            for node in constants:
                ops.constant(context, node)
            construct_op(context, construct_node)
            ops.tupleunpack(context, unpack_node)

        ssa_constants = []
        for name in constants_unpacked:
            ssa_constants.append(context[name].val)
        assert ssa_constants == constant_vals

        if dynamic:
            ssa_dyanmic = context[graph_input_name + "_out"]
            assert ssa_dyanmic.val is None
            assert ssa_dyanmic.shape == input_shape

            if @dynamic is True then packs up a dynamic input
            if @test_tuple is True tests tupleUnpack else tests listUnpack
        
coremltools/converters/mil/frontend/torch/test/test_internal_graph.py