Skip to content

Commit b15e2bd

Browse files
jmitrevsvloncar
authored andcommitted
prevent test directory overwrites for activation
1 parent 7255cbc commit b15e2bd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/pytest/test_keras_api.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ def test_dense(backend, io_type):
8080
@pytest.mark.parametrize(
8181
"activation_function",
8282
[
83-
Activation(activation='relu', name='Activation'),
83+
Activation(activation='relu', name='relu'),
8484
LeakyReLU(alpha=1.0),
8585
ELU(alpha=1.0),
8686
PReLU(
8787
alpha_initializer="zeros",
8888
),
89-
Activation(activation='sigmoid', name='Activation'),
89+
Activation(activation='sigmoid', name='sigmoid'),
9090
],
9191
)
9292
# ThresholdedReLU(theta=1.0)])
@@ -101,9 +101,7 @@ def test_activations(activation_function, backend, io_type):
101101
X_input = np.random.rand(100, 1)
102102
keras_prediction = model.predict(X_input)
103103
config = hls4ml.utils.config_from_keras_model(model)
104-
output_dir = str(
105-
test_root_path / f'hls4mlprj_keras_api_activations_{activation_function.__class__.__name__}_{backend}_{io_type}'
106-
)
104+
output_dir = str(test_root_path / f'hls4mlprj_keras_api_activations_{activation_function.name}_{backend}_{io_type}')
107105
hls_model = hls4ml.converters.convert_from_keras_model(
108106
model, hls_config=config, output_dir=output_dir, backend=backend, io_type=io_type
109107
)

0 commit comments

Comments
 (0)