parameters: (mode, hparams)
docstring: Either train or evaluate a clause search model.
  
    Args:
      mode: Either 'train' or 'test'.
      hparams: Hyperparameters.
  
    Raises:
      ValueError: If mode is not 'train' or 'eval'.
docstring_summary: Either train or evaluate a clause search model.
docstring_tokens: Either train or evaluate a clause search model .
function: def run_mode(mode, hparams):
    """Either train or evaluate a clause search model.
  
    Args:
      mode: Either 'train' or 'test'.
      hparams: Hyperparameters.
  
    Raises:
      ValueError: If mode is not 'train' or 'eval'.
    """
    if hparams.seed:
      tf.set_random_seed(hparams.seed)
    model = lambda: full_model(mode, hparams)
    if mode == 'train':
      train.sigmoid_train(model, hparams=hparams, joint_safe=True)
    elif mode == 'eval':
      train.sigmoid_eval(model, hparams=hparams, joint_safe=True)
    else:
      raise ValueError('Invalid --mode=%r' % mode)
function_tokens: def run_mode ( mode , hparams ) : if hparams . seed : tf . set_random_seed ( hparams . seed ) model = lambda : full_model ( mode , hparams ) if mode == 'train' : train . sigmoid_train ( model , hparams = hparams , joint_safe = True ) elif mode == 'eval' : train . sigmoid_eval ( model , hparams = hparams , joint_safe = True ) else : raise ValueError ( 'Invalid --mode=%r' % mode )