mirror of
https://github.com/zama-ai/concrete.git
synced 2026-01-11 05:47:56 -05:00
1.2 KiB
1.2 KiB
Examples
This document gives an overview of the structure of the examples, which are tutorials containing more or less elaborated usages of Concrete, to showcase its functionality on practical use cases. Examples are either provided as a Python script or a Jupyter notebook.
Concrete Python
How to create an example?
Jupyter notebook example
- Create
examples/foo/foo.ipynb - Write the example in the notebook
- The notebook will be executed in the CI with
make test-notebookstarget
Python script example
- Create
examples/foo/foo.py - Write the example in the script
- Example should contain a class called
Foo Fooshould have the following arguments in its__init__:- configuration: Optional[fhe.Configuration] = None
- compiled: bool = True
- It should compile the circuit with an appropriate inputset using the given configuration if compiled is true
- It should have any additional common utilities (e.g., encoding/decoding) shared between the tests and the benchmarks
- Example should contain a class called
- Then, add tests for the implementation in
tests/execution/test_examples.py - Optionally, create
benchmarks/foo.pyand add benchmarks.