mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
test: create default_compilation_configuration fixture
- update test code and use it where appropriate - remove duplicate tests that lacked correctness verification
This commit is contained in:
@@ -9,7 +9,7 @@ from concrete.common.values import EncryptedScalar
|
||||
from concrete.numpy.compile import compile_numpy_function
|
||||
|
||||
|
||||
def test_artifacts_export():
|
||||
def test_artifacts_export(default_compilation_configuration):
|
||||
"""Test function to check exporting compilation artifacts"""
|
||||
|
||||
def function(x):
|
||||
@@ -23,6 +23,7 @@ def test_artifacts_export():
|
||||
function,
|
||||
{"x": EncryptedScalar(UnsignedInteger(7))},
|
||||
[(i,) for i in range(10)],
|
||||
default_compilation_configuration,
|
||||
compilation_artifacts=artifacts,
|
||||
)
|
||||
|
||||
|
||||
@@ -40,7 +40,9 @@ def simple_fuse_not_output(x):
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_enable_topological_optimizations(test_helpers, function_to_trace, fused):
|
||||
def test_enable_topological_optimizations(
|
||||
test_helpers, function_to_trace, fused, default_compilation_configuration
|
||||
):
|
||||
"""Test function for enable_topological_optimizations flag of compilation configuration"""
|
||||
|
||||
op_graph = compile_numpy_function_into_op_graph(
|
||||
@@ -50,7 +52,7 @@ def test_enable_topological_optimizations(test_helpers, function_to_trace, fused
|
||||
for param in signature(function_to_trace).parameters.keys()
|
||||
},
|
||||
[(i,) for i in range(10)],
|
||||
CompilationConfiguration(dump_artifacts_on_unexpected_failures=False),
|
||||
default_compilation_configuration,
|
||||
)
|
||||
op_graph_not_optimized = compile_numpy_function_into_op_graph(
|
||||
function_to_trace,
|
||||
@@ -62,6 +64,7 @@ def test_enable_topological_optimizations(test_helpers, function_to_trace, fused
|
||||
CompilationConfiguration(
|
||||
dump_artifacts_on_unexpected_failures=False,
|
||||
enable_topological_optimizations=False,
|
||||
treat_warnings_as_errors=True,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user