mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
feat: implement internal module
This commit is contained in:
3
concrete/numpy/internal/__init__.py
Normal file
3
concrete/numpy/internal/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
Declaration of `concrete.numpy.internal` namespace.
|
||||
"""
|
||||
31
concrete/numpy/internal/utils.py
Normal file
31
concrete/numpy/internal/utils.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
Declaration of various functions and constants related to the entire project.
|
||||
"""
|
||||
|
||||
|
||||
def assert_that(condition: bool, message: str = ""):
|
||||
"""
|
||||
Assert a condition.
|
||||
|
||||
Args:
|
||||
condition (bool):
|
||||
condition to assert
|
||||
|
||||
message (str):
|
||||
message to give to `AssertionError` if the condition does not hold
|
||||
|
||||
Raises:
|
||||
AssertionError:
|
||||
if the condition does not hold
|
||||
"""
|
||||
|
||||
if not condition:
|
||||
raise AssertionError(message)
|
||||
|
||||
|
||||
def unreachable():
|
||||
"""
|
||||
Raise a RuntimeError to indicate unreachable code is entered.
|
||||
"""
|
||||
|
||||
raise RuntimeError("Entered unreachable code")
|
||||
Reference in New Issue
Block a user