Skip to content

Commit e5b1f17

Browse files
authored
update namespace pytest, make model weights not be all zeros (#1331)
1 parent 8efbf6f commit e5b1f17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/pytest/test_writer_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@pytest.fixture(scope='module')
1515
def keras_model():
1616
model = Sequential()
17-
model.add(Dense(10, kernel_initializer='zeros', use_bias=False, input_shape=(15,)))
17+
model.add(Dense(10, input_shape=(15,)))
1818
model.compile()
1919
return model
2020

@@ -24,11 +24,11 @@ def keras_model():
2424
@pytest.mark.parametrize('namespace', [None, 'test_namespace'])
2525
def test_namespace(keras_model, namespace, io_type, backend):
2626

27-
use_namespace = namespace is None
27+
use_namespace = namespace is not None
2828
config = hls4ml.utils.config_from_keras_model(keras_model, granularity='name')
2929
odir = str(test_root_path / f'hls4mlprj_namespace_{use_namespace}_{backend}_{io_type}')
3030
hls_model = hls4ml.converters.convert_from_keras_model(
31-
keras_model, hls_config=config, io_type=io_type, output_dir=odir, backend=backend
31+
keras_model, hls_config=config, io_type=io_type, output_dir=odir, namespace=namespace, backend=backend
3232
)
3333
hls_model.compile() # It's enough that the model compiles
3434

0 commit comments

Comments
 (0)