code: def parameterized_vs_naive(shape, num_iters, use_gpu=False):
      np.random.seed(1618)  # Make it reproducible.
  
      # No CSE/CF.
      optimizer_options = config_pb2.OptimizerOptions(
          opt_level=config_pb2.OptimizerOptions.L0
      )
      config = config_pb2.ConfigProto(
          graph_options=config_pb2.GraphOptions(
              optimizer_options=optimizer_options
          )
      )
  
      with session.Session(config=config) as sess:
          with ops.device("/cpu:0" if not use_gpu else None):
              param_op = control_flow_ops.group(
                  random_ops.parameterized_truncated_normal(shape)
              )
              naive_op = control_flow_ops.group(
                  random_ops.truncated_normal(shape)
              )
  
          # Burn-in to avoid session setup costs in the timing.
          sess.run(param_op)
          sess.run(param_op)
          param_dt = timeit.timeit(
              lambda: sess.run(param_op), number=num_iters
          )
          sess.run(naive_op)
          sess.run(naive_op)
          naive_dt = timeit.timeit(
              lambda: sess.run(naive_op), number=num_iters
          )
          return param_dt, naive_dt
  
imports: import functools
  import math
  import timeit
  import numpy
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.eager import backprop
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  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 random_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 4 for calling a global function with example usage: parameterized_vs_naive(shape, num_iters, use_gpu) and returns: param_dt,  naive_dt