Table Lookups basics
Performance
Direct TLU
Scalar lookup
from concrete import fhe
table = fhe.LookupTable([2, -1, 3, 0])
@fhe.compiler({"x": "encrypted"})
def f(x):
return table[x]
inputset = range(4)
circuit = f.compile(inputset)
assert circuit.encrypt_run_decrypt(0) == table[0] == 2
assert circuit.encrypt_run_decrypt(1) == table[1] == -1
assert circuit.encrypt_run_decrypt(2) == table[2] == 3
assert circuit.encrypt_run_decrypt(3) == table[3] == 0Tensor lookup
Multi TLU
Transparent TLU
Optimizing input size
Truncating
Rounding
Approximate rounding
Last updated
Was this helpful?