feat: implement internal module

This commit is contained in:
Umut
2022-04-04 13:28:53 +02:00
parent 11fcaadb9f
commit 9bf9b3c743
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
"""
Declaration of `concrete.numpy.internal` namespace.
"""

View 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")