code: def build_graph(
      device,
      dtype,
      data_format,
      input_shape,
      filter_shape,
      strides,
      padding,
      num_iters,
      warmup_iters,
  ):
      """builds a graph containing a sequence of conv2d operations.
  
      Args:
        device: String, the device to run on.
        dtype: Data type for the convolution.
        data_format: A string from: "NHWC" or "NCHW". Data format for input and
                     output data.
        input_shape: Shape of the input tensor.
        filter_shape: Shape of the filter tensor.
        strides: A list of ints. 1-D of length 4. The stride of sliding
                 window for each dimension of input.
        padding: A string from: "SAME", "VALID". The type of padding
                 algorithm to use.
        num_iters: number of iterations to run conv2d.
        warmup_iters: number of iterations for warmup runs.
  
      Returns:
        An array of tensors to run()
      """
      with ops.device("/%s:0" % device):
          inp = variable_v1.VariableV1(
              random_ops.truncated_normal(input_shape, dtype=dtype)
          )
          filt = variable_v1.VariableV1(
              random_ops.truncated_normal(filter_shape, dtype=dtype)
          )
  
          outputs = []
          conv2d_op = nn_ops.conv2d(
              inp, filt, strides, padding, data_format=data_format
          )
          outputs.append(conv2d_op)
          for _ in range(1, num_iters):
              with ops.control_dependencies([conv2d_op]):
                  conv2d_op = nn_ops.conv2d(
                      inp,
                      filt,
                      strides,
                      padding,
                      data_format=data_format,
                  )
                  outputs.append(conv2d_op)
  
          warmup_groups = []
          warmup_conv2d_op = nn_ops.conv2d(
              inp, filt, strides, padding, data_format=data_format
          )
          warmup_groups.append(warmup_conv2d_op)
          for _ in range(1, warmup_iters):
              with ops.control_dependencies([warmup_conv2d_op]):
                  warmup_conv2d_op = nn_ops.conv2d(
                      inp,
                      filt,
                      strides,
                      padding,
                      data_format=data_format,
                  )
                  warmup_groups.append(warmup_conv2d_op)
          return control_flow_ops.group(
              *warmup_groups
          ), control_flow_ops.group(*outputs)
  
file_path: tensorflow-upstream/tensorflow/python/ops/conv2d_benchmark.py
imports: import itertools
  import time
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import flags
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling a global function with example usage: build_graph(device, dtype, data_format, input_shape, filter_shape, strides, padding, num_iters, warmup_iters) and returns: control_flow_ops,  control_flow_ops