Skip to content

Commit

Permalink
chore(frontend): add shortcut property to get server in fhe modules
Browse files Browse the repository at this point in the history
  • Loading branch information
aPere3 committed Mar 29, 2024
1 parent 4068046 commit 4f48c25
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions frontends/concrete-python/concrete/fhe/compilation/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,13 @@ def statistics(self) -> Dict:
}
return statistics

@property
def server(self) -> Server:
"""
Get the server used by the runtime.
"""
return self.runtime.server

def functions(self) -> Dict[str, FheFunction]:
"""
Return a dictionnary containing all the functions of the module.
Expand Down
3 changes: 2 additions & 1 deletion frontends/concrete-python/tests/compilation/test_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ def dec(x):
composable=True,
verbose=True,
)
Module.compile(
compiled = Module.compile(
{"inc": inputset, "dec": inputset},
configuration,
)
assert isinstance(compiled.server, fhe.Server)


def test_compiled_clear_call(helpers):
Expand Down

0 comments on commit 4f48c25

Please sign in to comment.