code: def build_graph(device, n, m, k, transpose_a, transpose_b, dtype):
      """Build a graph containing a sequence of matmul operations.
  
      Args:
        device: String, the device to run on.
        n: tensor A's first dimension size.
        m: tensor A's second dimension size.
        k: tensor B's second dimension size.
        transpose_a: boolean value to show if tensor A is transposed.
        transpose_b: boolean value to show if tensor B is transposed.
        dtype: numpy data type of the input tensor.
  
      Returns:
        A matmul operation to run()
      """
      with ops.device("%s" % device):
          if not transpose_a:
              x = variable_v1.VariableV1(
                  random_ops.random_uniform([n, m], dtype=dtype),
                  use_resource=False,
              )
          else:
              x = variable_v1.VariableV1(
                  random_ops.random_uniform([m, n], dtype=dtype),
                  use_resource=False,
              )
          if not transpose_b:
              y = variable_v1.VariableV1(
                  random_ops.random_uniform([m, k], dtype=dtype),
                  use_resource=False,
              )
          else:
              y = variable_v1.VariableV1(
                  random_ops.random_uniform([k, m], dtype=dtype),
                  use_resource=False,
              )
  
          z = math_ops.matmul(
              x, y, transpose_a=transpose_a, transpose_b=transpose_b
          )
          return control_flow_ops.group(z)
  
file_path: tensorflow/tensorflow/python/ops/matmul_benchmark.py
imports: import itertools
  import time
  import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import math_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 test
label_desc: Use image node_id 1 for calling a global function with example usage: build_graph(device, n, m, k, transpose_a, transpose_b, dtype) and returns: control_flow_ops