From 9cb8e30cbfe7b3deaf60d3b150250c917ecd2a34 Mon Sep 17 00:00:00 2001 From: Umut Date: Mon, 2 Jan 2023 14:40:33 +0100 Subject: [PATCH] fix: update outdated documentation of sanitize signed inputs helper --- concrete/numpy/mlir/graph_converter.py | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/concrete/numpy/mlir/graph_converter.py b/concrete/numpy/mlir/graph_converter.py index 56a3ae95e..05a71fb2d 100644 --- a/concrete/numpy/mlir/graph_converter.py +++ b/concrete/numpy/mlir/graph_converter.py @@ -508,25 +508,7 @@ class GraphConverter: @staticmethod def _sanitize_signed_inputs(graph: Graph, args: List[Any], ctx: Context) -> List[Any]: """ - Apply table lookup to signed inputs in the beginning of evaluation to sanitize them. - - Sanitization in this context means to apply a table lookup to obtain proper input values. - - "encrypt" method of "Client" class will convert negative inputs to their corresponding - unsigned value in 2s complement representation. - - Here is an example for 3 bits: - 000 = 0 represents 0 - 001 = 1 represents 1 - 010 = 2 represents 2 - 011 = 3 represents 3 - 100 = 4 represents -4 - 101 = 5 represents -3 - 110 = 6 represents -2 - 111 = 7 represents -1 - - And, the following table lookup is applied before anything else to sanitize the inputs: - [0, 1, 2, 3, -4, -3, -2, -1] + Use subtraction to sanitize signed inputs. Args: graph (Graph):