mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-12 13:45:08 -05:00
feat(float-fusing): fuse float parts of an OPGraph during compilation
- this allows to be compatible with the current compiler and squash float domains into a single int to int ArbitraryFunction
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Test file for hnumpy compilation functions"""
|
||||
import itertools
|
||||
|
||||
import numpy
|
||||
import pytest
|
||||
|
||||
from hdk.common.data_types.integers import Integer
|
||||
@@ -10,6 +11,14 @@ from hdk.common.extensions.table import LookupTable
|
||||
from hdk.hnumpy.compile import compile_numpy_function
|
||||
|
||||
|
||||
def no_fuse_unhandled(x, y):
|
||||
"""No fuse unhandled"""
|
||||
x_intermediate = x + 2.8
|
||||
y_intermediate = y + 9.3
|
||||
intermediate = x_intermediate + y_intermediate
|
||||
return intermediate.astype(numpy.int32)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"function,input_ranges,list_of_arg_names",
|
||||
[
|
||||
@@ -21,6 +30,12 @@ from hdk.hnumpy.compile import compile_numpy_function
|
||||
((4, 8), (3, 4), (0, 4)),
|
||||
["x", "y", "z"],
|
||||
),
|
||||
pytest.param(
|
||||
no_fuse_unhandled,
|
||||
((-2, 2), (-2, 2)),
|
||||
["x", "y"],
|
||||
marks=pytest.mark.xfail(raises=ValueError),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_compile_function_multiple_outputs(function, input_ranges, list_of_arg_names):
|
||||
|
||||
Reference in New Issue
Block a user