I’m trying to compile the right shift function np.right_shift which is under the list of supported numpy functions but I run into an error. This seems to be the case with all multi input bitwise operators. Functions such as np.add work fine. Even these functions as long as I make them single parameter, they work fine. i.e return np.right_shift(x,2)
My code:
import concrete.numpy as cnp
def shift_right(x,n):
return np.right_shift(x,n)
compiler = cnp.Compiler(shift_right, {"x": "encrypted", "n": "encrypted"})
circuit = compiler.compile(inputset)
inputset = [(2, 3), (0, 0), (1, 6), (7, 7), (7, 1), (3, 2), (6, 1), (1, 7), (4, 5), (5, 4)]
RuntimeError: Function you are trying to compile cannot be converted to MLIR
%0 = x # EncryptedScalar
%1 = n # EncryptedScalar
%2 = right_shift(%0, %1) # EncryptedScalar
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only single input table lookups are supported
return %2
What am I missing ?