code: def create_models(features, layers, units):
      postfix = str(uuid.uuid4())[:8]
      input_name = "input_" + postfix
      output_name = "output_" + postfix
  
      tf_cpu_x, tf_cpu_y = create_tf_model(
          features, layers, units, "/cpu:0", input_name, output_name
      )
      tf_gpu_x, tf_gpu_y = create_tf_model(
          features, layers, units, "/gpu:0", input_name, output_name
      )
  
      tf_sess = tf.Session()
      tf_sess.run(tf.initialize_all_variables())
  
      td_model = td.Model()
      td_model.add(tf_cpu_y, tf_sess)
      td_x, td_y = td_model.get(input_name, output_name)
  
      tf_cpu_fn = lambda batch: tf_sess.run(
          tf_cpu_y, feed_dict={tf_cpu_x: batch}
      )
      tf_gpu_fn = lambda batch: tf_sess.run(
          tf_gpu_y, feed_dict={tf_gpu_x: batch}
      )
      td_fn = lambda batch: td_y.eval({td_x: batch})
  
      return collections.OrderedDict(
          [("tf_cpu", tf_cpu_fn), ("tf_gpu", tf_gpu_fn), ("td", td_fn)]
      )
  
file_path: tfdeploy/tests/perf/measure_runtimes.py
imports: import os
  import time
  import json
  import uuid
  import itertools
  import collections
  import numpy
  import tensorflow
  import tfdeploy
label_desc: Use image node_id 2 for calling a global function with example usage: create_models(features, layers, units) and returns: collections