From c46d96aabf9ceb6914255c7a5032d8cee65b9bea Mon Sep 17 00:00:00 2001 From: Umut Date: Mon, 25 Oct 2021 17:19:35 +0300 Subject: [PATCH] refactor(compilation): improve error messages of indexing --- concrete/common/mlir/utils.py | 3 +-- tests/numpy/test_compile.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/concrete/common/mlir/utils.py b/concrete/common/mlir/utils.py index 4dcc60d86..cc75113c0 100644 --- a/concrete/common/mlir/utils.py +++ b/concrete/common/mlir/utils.py @@ -73,8 +73,7 @@ def check_node_compatibility_with_mlir(node: IntermediateNode, is_output: bool) elif isinstance(node, intermediate.IndexConstant): # constraints for constant indexing assert_true(len(outputs) == 1) - if not value_is_unsigned_integer(outputs[0]): - return "only unsigned integer tensor constant indexing is supported" + return "indexing is not supported for the time being" else: # pragma: no cover assert_not_reached("Non IntermediateNode object in the OPGraph") diff --git a/tests/numpy/test_compile.py b/tests/numpy/test_compile.py index 688875797..95a76b6a7 100644 --- a/tests/numpy/test_compile.py +++ b/tests/numpy/test_compile.py @@ -862,7 +862,7 @@ def test_compile_function_with_direct_tlu_overflow(default_compilation_configura "%0 = x # EncryptedTensor, shape=(2, 2)>\n" # noqa: E501 # pylint: disable=line-too-long "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only unsigned integer inputs are supported\n" # noqa: E501 # pylint: disable=line-too-long "%1 = IndexConstant(%0[0]) # EncryptedTensor, shape=(2,)>\n" # noqa: E501 # pylint: disable=line-too-long - "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only unsigned integer tensor constant indexing is supported\n" # noqa: E501 # pylint: disable=line-too-long + "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ indexing is not supported for the time being\n" # noqa: E501 # pylint: disable=line-too-long "return(%1)\n" ), ),