parameters: (hparam_str)
return_statement: return hparams
docstring: Parse hyperparameters from the given flag value.
docstring_summary: Parse hyperparameters from the given flag value.
docstring_tokens: Parse hyperparameters from the given flag value .
function: def parse_hparams(hparam_str):
    """Parse hyperparameters from the given flag value."""
    m = re.search(r'(?:^|,)model=(\w+)(?:,|$)', hparam_str)
    if not m:
      raise ValueError('No model specified in --hparams=%r' % hparam_str)
    input_hparams = tf.contrib.training.HParams(
        model='',  # Name of the model to run
        embedding_size=256,  # Word embedding dimension
    )
    hparams = model_utils.merge_hparams(train.default_hparams(),
                                        all_models.model_hparams(m.group(1)),
                                        input_hparams)
    hparams.parse(hparam_str)
    return hparams
function_tokens: def parse_hparams ( hparam_str ) : m = re . search ( r'(?:^|,)model=(\w+)(?:,|$)' , hparam_str ) if not m : raise ValueError ( 'No model specified in --hparams=%r' % hparam_str ) input_hparams = tf . contrib . training . HParams ( model = '' , # Name of the model to run embedding_size = 256 , # Word embedding dimension ) hparams = model_utils . merge_hparams ( train . default_hparams ( ) , all_models . model_hparams ( m . group ( 1 ) ) , input_hparams ) hparams . parse ( hparam_str ) return hparams