code: def run_torch_job(job):
      """Run a torch based job."""
  
      params = {}
      for param in job.param:
          dbl_vals = param.dbl_val._values
          int_vals = param.int_val._values
          str_vals = param.str_val._values
  
          if len(dbl_vals) > 0:
              params[param.name] = dbl_vals
          elif len(int_vals) > 0:
              params[param.name] = int_vals
          elif len(str_vals) > 0:
              params[param.name] = str_vals
          else:
              raise Exception("Unknown parameter type.")
  
      # TODO: this passes args correctly for experiment utils, but we need to
      # figure out how to get the result back out when the experiment completes.
  
      param_str = ""
      for pname, pval in params.iteritems():
          if len(pval) == 1:
              pval = str(pval[0])
          else:
              pval = ",".join([str(v) for v in pval])
  
          param_str += "-" + pname + " " + pval + " "
  
      cmd = "./%s %s" % (job.name, param_str)
      log("Executing command: %s\n" % (cmd))
      sh(cmd)
  
file_path: auptimizer/src/aup/Proposer/spearmint/runner.py
imports: import sys
  import os
  import traceback
  from spearmint_pb2 import *
  from ExperimentGrid import *
  from helpers import *
label_desc: Use image node_id 4 for calling a global function with example usage: run_torch_job(job) without return types