tf2_gnn/cli_utils/param_helpers.py
def override_model_params_with_hyperdrive_params(
    model_params: Dict[str, Any], hyperdrive_params: Dict[str, str]
):
    """
    Overrides the model parameters, with those from hyperdrive_params. hyperdrive_params contains hyperparameter values as strings. 
	The correct type is inferred from the model params (only the value is used from hyperdrive_params)
    """
    for k in hyperdrive_params.keys():
        if k not in model_params:
            raise ValueError(f"key {k} not found in model_params: {model_params}")

        if type(model_params[k]) == bool:
            model_params[k] = to_bool(hyperdrive_params[k])
        elif type(model_params[k]) == int:
            model_params[k] = int(hyperdrive_params[k])
        elif type(model_params[k]) == float:
            model_params[k] = float(hyperdrive_params[k])
        elif type(model_params[k]) == list and type(model_params[k][0]) == int:
            model_params[k] = str_to_list_of_ints(hyperdrive_params[k])
        elif type(model_params[k]) == str:
            model_params[k] = hyperdrive_params[k]
        else:
            raise ValueError(f"Unknown hyperparameter type {type(model_params[k])} for hyperparameter {k}.")
    return

    Overrides the model parameters, with those from hyperdrive_params. hyperdrive_params contains hyperparameter values as strings. 
	The correct type is inferred from the model params (only the value is used from hyperdrive_params)
    
Overrides the model parameters, with those from hyperdrive_params. hyperdrive_params contains hyperparameter values as strings.
The correct type is inferred from the model params (only the value is used from hyperdrive_params)
Overrides the model parameters with those from hyperdrive_params . hyperdrive_params contains hyperparameter values as strings . The correct type is inferred from the model params ( only the value is used from hyperdrive_params )
def override_model_params_with_hyperdrive_params(
    model_params: Dict[str, Any], hyperdrive_params: Dict[str, str]
):
    for k in hyperdrive_params.keys():
        if k not in model_params:
            raise ValueError(f"key {k} not found in model_params: {model_params}")
        if type(model_params[k]) == bool:
            model_params[k] = to_bool(hyperdrive_params[k])
        elif type(model_params[k]) == int:
            model_params[k] = int(hyperdrive_params[k])
        elif type(model_params[k]) == float:
            model_params[k] = float(hyperdrive_params[k])
        elif type(model_params[k]) == list and type(model_params[k][0]) == int:
            model_params[k] = str_to_list_of_ints(hyperdrive_params[k])
        elif type(model_params[k]) == str:
            model_params[k] = hyperdrive_params[k]
        else:
            raise ValueError(f"Unknown hyperparameter type {type(model_params[k])} for hyperparameter {k}.")
    return
def override_model_params_with_hyperdrive_params ( model_params : Dict [ str , Any ] , hyperdrive_params : Dict [ str , str ] ) : for k in hyperdrive_params . keys ( ) : if k not in model_params : raise ValueError ( f"key {k} not found in model_params: {model_params}" ) if type ( model_params [ k ] ) == bool : model_params [ k ] = to_bool ( hyperdrive_params [ k ] ) elif type ( model_params [ k ] ) == int : model_params [ k ] = int ( hyperdrive_params [ k ] ) elif type ( model_params [ k ] ) == float : model_params [ k ] = float ( hyperdrive_params [ k ] ) elif type ( model_params [ k ] ) == list and type ( model_params [ k ] [ 0 ] ) == int : model_params [ k ] = str_to_list_of_ints ( hyperdrive_params [ k ] ) elif type ( model_params [ k ] ) == str : model_params [ k ] = hyperdrive_params [ k ] else : raise ValueError ( f"Unknown hyperparameter type {type(model_params[k])} for hyperparameter {k}." ) return
Overrides the model parameters, with those from hyperdrive_params.
Overrides the model parameters with those from hyperdrive_params .
"""
    Overrides the model parameters, with those from hyperdrive_params. hyperdrive_params contains hyperparameter values as strings. 
	The correct type is inferred from the model params (only the value is used from hyperdrive_params)
    """
model_params
Dict[str, Any]
hyperdrive_params
Dict[str, str]