code: def build_graph(device, input_shape, perm, datatype, num_iters):
      """builds a graph containing a sequence of conv2d operations.
  
      Args:
        device: String, the device to run on.
        input_shape: Shape of the input tensor.
        perm: A list of ints with the same length as input tensor's dimension.
        datatype: numpy data type of the input tensor.
        num_iters: number of iterations to run transpose.
  
      Returns:
        An array of tensors to run()
      """
      with ops.device("/%s:0" % device):
          total_size = np.prod(input_shape)
          inp = np.arange(1, total_size + 1, dtype=datatype).reshape(
              input_shape
          )
          t = constant_op.constant(inp, shape=input_shape)
  
          outputs = []
          transpose_op = array_ops.transpose(t, perm)
          outputs.append(transpose_op)
          for _ in range(1, num_iters):
              with ops.control_dependencies([transpose_op]):
                  transpose_op = array_ops.transpose(t, perm)
                  outputs.append(transpose_op)
          return control_flow_ops.group(*outputs)
  
file_path: tensorflow/tensorflow/python/ops/transpose_benchmark.py
imports: import time
  import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: build_graph(device, input_shape, perm, datatype, num_iters) and returns: control_flow_ops