import time

import tensorflow as tf

# Define a class that extends from tf.test.Benchmark.
class SampleBenchmark(tf.test.Benchmark):

  # Note: benchmark method name must start with `benchmark`.
  def benchmarkSum(self):
    with tf.Session() as sess:
      x = tf.constant(10)
      y = tf.constant(5)
      result = tf.add(x, y)

      iters = 100
      start_time = time.time()
      for _ in range(iters):
        sess.run(result)
      total_wall_time = time.time() - start_time

      # Call report_benchmark to report a metric value.
      self.report_benchmark(
          name="sum_wall_time",
          # This value should always be per iteration.
          wall_time=total_wall_time/iters,
          iters=iters)

if __name__ == "__main__":
  tf.test.main()


157c87b2e809032f6a4472dd30e65fc89b594c20
<mask token>

<mask token>


class SampleBenchmark(tf.test.Benchmark):
    <mask token>


<mask token>

<mask token>


class SampleBenchmark(tf.test.Benchmark):

    def benchmarkSum(self):
        with tf.Session() as sess:
            x = tf.constant(10)
            y = tf.constant(5)
            result = tf.add(x, y)
            iters = 100
            start_time = time.time()
            for _ in range(iters):
                sess.run(result)
            total_wall_time = time.time() - start_time
            self.report_benchmark(name='sum_wall_time', wall_time=
                total_wall_time / iters, iters=iters)


<mask token>

<mask token>


class SampleBenchmark(tf.test.Benchmark):

    def benchmarkSum(self):
        with tf.Session() as sess:
            x = tf.constant(10)
            y = tf.constant(5)
            result = tf.add(x, y)
            iters = 100
            start_time = time.time()
            for _ in range(iters):
                sess.run(result)
            total_wall_time = time.time() - start_time
            self.report_benchmark(name='sum_wall_time', wall_time=
                total_wall_time / iters, iters=iters)


if __name__ == '__main__':
    tf.test.main()

import time

import tensorflow as tf

# Define a class that extends from tf.test.Benchmark.
class SampleBenchmark(tf.test.Benchmark):

  # Note: benchmark method name must start with `benchmark`.
  def benchmarkSum(self):
    with tf.Session() as sess:
      x = tf.constant(10)
      y = tf.constant(5)
      result = tf.add(x, y)

      iters = 100
      start_time = time.time()
      for _ in range(iters):
        sess.run(result)
      total_wall_time = time.time() - start_time

      # Call report_benchmark to report a metric value.
      self.report_benchmark(
          name="sum_wall_time",
          # This value should always be per iteration.
          wall_time=total_wall_time/iters,
          iters=iters)

if __name__ == "__main__":
  tf.test.main()

