code: def benchmarkMatrixBandPartOp(self):
      for shape_ in self.shapes:
          for limits in (-1, -1), (-1, 0), (0, -1), (2, 2):
              with ops.Graph().as_default(), session.Session(
                  config=benchmark.benchmark_config()
              ) as sess, ops.device("/cpu:0"):
                  matrix = variables.Variable(array_ops.ones(shape_))
                  band = array_ops.matrix_band_part(
                      matrix, limits[0], limits[1]
                  )
                  self.evaluate(
                      variables.global_variables_initializer()
                  )
                  self.run_op_benchmark(
                      sess,
                      control_flow_ops.group(band),
                      min_iters=10,
                      name="matrix_band_part_cpu_{shape}_{limits}".format(
                          shape=shape_, limits=limits
                      ),
                  )
  
              if test_lib.is_gpu_available(True):
                  with ops.Graph().as_default(), session.Session(
                      config=benchmark.benchmark_config()
                  ) as sess, ops.device("/gpu:0"):
                      matrix = variables.Variable(
                          array_ops.ones(shape_)
                      )
                      band = array_ops.matrix_band_part(
                          matrix, limits[0], limits[1]
                      )
                      self.evaluate(
                          variables.global_variables_initializer()
                      )
                      self.run_op_benchmark(
                          sess,
                          control_flow_ops.group(band),
                          min_iters=10,
                          name="matrix_band_part_gpu_{shape}_{limits}".format(
                              shape=shape_, limits=limits
                          ),
                      )
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the MatrixBandPartBenchmark obj's underlying member method code with example usage: obj.benchmarkMatrixBandPartOp() without return types