code: def testControlDependencies(self):
      v = variables.Variable(1)
  
      @def_function.function
      def fn(inp):
          assign = v.assign(3, name="assign", read_value=False)
          x = constant_op.constant(2.0, name="x")
          # TODO(b/79881896): Test external control dependency once that's
          # supported.
          with ops.control_dependencies([x, inp, assign]):
              constant_op.constant(3.0, name="y")
          return 4.0
  
      inp = constant_op.constant(1.0)
      fdef = fn.get_concrete_function(inp).function_def
      func_graph = function_def_to_graph.function_def_to_graph(fdef)
  
      op = func_graph.get_operation_by_name("y")
      self.assertEqual(len(op.control_inputs), 3)
      self.assertEqual(op.control_inputs[0].name, "assign")
      self.assertEqual(op.control_inputs[1].name, "inp")
      self.assertEqual(op.control_inputs[2].name, "x")
  
imports: from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import function_def_to_graph
  from tensorflow.python.framework import graph_to_function_def
  from tensorflow.python.framework import op_def_library
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the FunctionDefToGraphDefTest obj's underlying member method code with example usage: obj.testControlDependencies() and returns: int