-
Notifications
You must be signed in to change notification settings - Fork 129
/
library_lambda.py
31 lines (23 loc) · 1.03 KB
/
library_lambda.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Part of the Concrete Compiler Project, under the BSD3 License with Zama Exceptions.
# See https://github.com/zama-ai/concrete/blob/main/LICENSE.txt for license information.
"""LibraryLambda."""
# pylint: disable=no-name-in-module,import-error
from mlir._mlir_libs._concretelang._compiler import (
LibraryLambda as _LibraryLambda,
)
# pylint: enable=no-name-in-module,import-error
from .wrapper import WrapperCpp
class LibraryLambda(WrapperCpp):
"""LibraryLambda reference a compiled library and can be ran using LibrarySupport."""
def __init__(self, library_lambda: _LibraryLambda):
"""Wrap the native Cpp object.
Args:
library_lambda (_LibraryLambda): object to wrap
Raises:
TypeError: if library_lambda is not of type _LibraryLambda
"""
if not isinstance(library_lambda, _LibraryLambda):
raise TypeError(
f"library_lambda must be of type _LibraryLambda, not {type(library_lambda)}"
)
super().__init__(library_lambda)