From 2351730cee436fbe104942e681896193dd5f2b84 Mon Sep 17 00:00:00 2001 From: Benoit Chevallier-Mames Date: Wed, 29 Sep 2021 11:44:04 +0200 Subject: [PATCH] feat: adding management of numpy.absolute refs #126 --- concrete/numpy/tracing.py | 2 +- tests/numpy/test_tracing.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/concrete/numpy/tracing.py b/concrete/numpy/tracing.py index 6198b7ca7..24e19f74b 100644 --- a/concrete/numpy/tracing.py +++ b/concrete/numpy/tracing.py @@ -191,7 +191,7 @@ class NPTracer(BaseTracer): LIST_OF_SUPPORTED_UFUNC: List[numpy.ufunc] = [ # The commented functions are functions which don't work for the moment, often # if not always because they require more than a single argument - # numpy.absolute, + numpy.absolute, # numpy.add, numpy.arccos, numpy.arccosh, diff --git a/tests/numpy/test_tracing.py b/tests/numpy/test_tracing.py index b554c30ee..aa47196b0 100644 --- a/tests/numpy/test_tracing.py +++ b/tests/numpy/test_tracing.py @@ -368,7 +368,12 @@ def test_trace_numpy_supported_ufuncs(inputs, expected_output_node): if function_to_trace_def in LIST_OF_UFUNC_WHOSE_OUTPUT_IS_FLOAT64: assert op_graph.output_nodes[0].outputs[0] == EncryptedScalar(Float(64)) else: - assert op_graph.output_nodes[0].outputs[0] == "to be done" + assert op_graph.output_nodes[0].outputs[0] in [ + EncryptedScalar(Integer(32, is_signed=False)), + EncryptedScalar(Integer(32, is_signed=True)), + EncryptedScalar(Integer(64, is_signed=True)), + EncryptedScalar(Float(64)), + ] def test_trace_numpy_ufuncs_not_supported():