Files
concrete/docs/dev/api/concrete.fhe.extensions.table.md
Benoit Chevallier-Mames e37a840e7e docs(compiler): adding API doc
2024-03-13 17:10:00 +01:00

65 lines
1.6 KiB
Markdown

<!-- markdownlint-disable -->
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/fhe/extensions/table.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
# <kbd>module</kbd> `concrete.fhe.extensions.table`
Declaration of `LookupTable` class.
---
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/fhe/extensions/table.py#L15"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
## <kbd>class</kbd> `LookupTable`
LookupTable class, to provide a way to do direct table lookups.
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/fhe/extensions/table.py#L23"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
### <kbd>method</kbd> `__init__`
```python
__init__(table: Any)
```
---
<a href="../../../compilers/concrete-compiler/compiler/lib/Bindings/Python/concrete/fhe/extensions/table.py#L93"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
### <kbd>method</kbd> `apply`
```python
apply(
key: Union[int, integer, bool_, ndarray],
table: ndarray
) Union[int, integer, ndarray]
```
Apply lookup table.
**Args:**
key (Union[int, np.integer, np.bool_, np.ndarray]): lookup key
table (np.ndarray): lookup table
**Returns:**
Union[int, np.integer, np.ndarray]: lookup result
**Raises:**
ValueError: if `table` cannot be looked up with `key`