Skip to content

Commit

Permalink
prevent test directory overwrites for activation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmitrevs authored and vloncar committed Jul 9, 2024
1 parent 7255cbc commit b15e2bd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/pytest/test_keras_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ def test_dense(backend, io_type):
@pytest.mark.parametrize(
"activation_function",
[
Activation(activation='relu', name='Activation'),
Activation(activation='relu', name='relu'),
LeakyReLU(alpha=1.0),
ELU(alpha=1.0),
PReLU(
alpha_initializer="zeros",
),
Activation(activation='sigmoid', name='Activation'),
Activation(activation='sigmoid', name='sigmoid'),
],
)
# ThresholdedReLU(theta=1.0)])
Expand All @@ -101,9 +101,7 @@ def test_activations(activation_function, backend, io_type):
X_input = np.random.rand(100, 1)
keras_prediction = model.predict(X_input)
config = hls4ml.utils.config_from_keras_model(model)
output_dir = str(
test_root_path / f'hls4mlprj_keras_api_activations_{activation_function.__class__.__name__}_{backend}_{io_type}'
)
output_dir = str(test_root_path / f'hls4mlprj_keras_api_activations_{activation_function.name}_{backend}_{io_type}')
hls_model = hls4ml.converters.convert_from_keras_model(
model, hls_config=config, output_dir=output_dir, backend=backend, io_type=io_type
)
Expand Down

0 comments on commit b15e2bd

Please sign in to comment.