From b579846621fd863af08fdf0c7f318e81faa80a17 Mon Sep 17 00:00:00 2001 From: Jovan Mitrevski Date: Tue, 15 Jul 2025 18:41:53 -0500 Subject: [PATCH] update namespace pytest, make model weights not be all zeros --- test/pytest/test_writer_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/pytest/test_writer_config.py b/test/pytest/test_writer_config.py index 61c9c03a0d..52a082ce49 100644 --- a/test/pytest/test_writer_config.py +++ b/test/pytest/test_writer_config.py @@ -14,7 +14,7 @@ @pytest.fixture(scope='module') def keras_model(): model = Sequential() - model.add(Dense(10, kernel_initializer='zeros', use_bias=False, input_shape=(15,))) + model.add(Dense(10, input_shape=(15,))) model.compile() return model @@ -24,11 +24,11 @@ def keras_model(): @pytest.mark.parametrize('namespace', [None, 'test_namespace']) def test_namespace(keras_model, namespace, io_type, backend): - use_namespace = namespace is None + use_namespace = namespace is not None config = hls4ml.utils.config_from_keras_model(keras_model, granularity='name') odir = str(test_root_path / f'hls4mlprj_namespace_{use_namespace}_{backend}_{io_type}') hls_model = hls4ml.converters.convert_from_keras_model( - keras_model, hls_config=config, io_type=io_type, output_dir=odir, backend=backend + keras_model, hls_config=config, io_type=io_type, output_dir=odir, namespace=namespace, backend=backend ) hls_model.compile() # It's enough that the model compiles