code: def benchmarkNativeOpVsComposedOps(self):
      num_iters = 50
      print(
          "Composition of existing ops vs. Native Multinomial op [%d iters]"
          % num_iters
      )
      print(
          "BatchSize\tNumClasses\tNumSamples\tsec(composed)\tsec(native)\t"
          "speedup"
      )
  
      for batch_size in [32, 128]:
          for num_classes in [10000, 100000]:
              for num_samples in [1, 4, 32]:
                  n_dt, c_dt = native_op_vs_composed_ops(
                      batch_size, num_classes, num_samples, num_iters
                  )
                  print(
                      "%d\t%d\t%d\t%.3f\t%.3f\t%.2f"
                      % (
                          batch_size,
                          num_classes,
                          num_samples,
                          c_dt,
                          n_dt,
                          c_dt / n_dt,
                      )
                  )
  
                  self.report_benchmark(
                      name="native_batch%d_classes%d_s%d"
                      % (batch_size, num_classes, num_samples),
                      iters=num_iters,
                      wall_time=n_dt,
                  )
                  self.report_benchmark(
                      name="composed_batch%d_classes%d_s%d"
                      % (batch_size, num_classes, num_samples),
                      iters=num_iters,
                      wall_time=c_dt,
                  )
  
imports: import collections
  import timeit
  import numpy
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import tensor_shape
  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 math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the MultinomialBenchmark obj's underlying member method code with example usage: obj.benchmarkNativeOpVsComposedOps() without return types