(params, key, value)
Adds a new item into `params`.
Adds a new item into `params`.
Adds a new item into params .
def _add_item_to_params(params, key, value):
  """Adds a new item into `params`."""
  if isinstance(params, hparam.HParams):
    # For HParams, we need to use special API.
    if key in params:
      params.set_hparam(key, value)
    else:
      params.add_hparam(key, value)
  else:
    # Now params is Python dict.
    params[key] = value
def _add_item_to_params ( params , key , value ) : if isinstance ( params , hparam . HParams ) : # For HParams, we need to use special API. if key in params : params . set_hparam ( key , value ) else : params . add_hparam ( key , value ) else : # Now params is Python dict. params [ key ] = value