def test_base_hyperparameter():
    base_param = hp_module.HyperParameter(name='base', default=0)
    assert base_param.name == 'base'
    assert base_param.default == 0
    assert base_param.get_config() == {'name': 'base', 'default': 0}
    base_param = hp_module.HyperParameter.from_config(base_param.get_config())
    assert base_param.name == 'base'
    assert base_param.default == 0
예제 #2
0
def test_base_hyperparameter():
    base_param = hp_module.HyperParameter(name="base", default=0)
    assert base_param.name == "base"
    assert base_param.default == 0
    assert base_param.get_config() == {
        "name": "base",
        "default": 0,
        "conditions": [],
    }
    base_param = hp_module.HyperParameter.from_config(base_param.get_config())
    assert base_param.name == "base"
    assert base_param.default == 0