mirror of
https://github.com/luxfhe/ml-sdk.git
synced 2026-10-30 18:13:04 +00:00
Machine Learning with FHE - fork of Zama Concrete-ML - Built-in FHE-friendly ML models - scikit-learn compatible API - PyTorch model conversion - Quantization-aware training
2.6 KiB
2.6 KiB
module concrete.ml.common.debugging.custom_assert
Provide some variants of assert.
function assert_true
assert_true(
condition: bool,
on_error_msg: str = '',
error_type: Type[Exception] = <class 'AssertionError'>
)
Provide a custom assert to check that the condition is True.
Args:
condition(bool): the condition. If False, raise AssertionErroron_error_msg(str): optional message for precising the error, in case of errorerror_type(Type[Exception]): the type of error to raise, if condition is not fulfilled. Default to AssertionError
function assert_false
assert_false(
condition: bool,
on_error_msg: str = '',
error_type: Type[Exception] = <class 'AssertionError'>
)
Provide a custom assert to check that the condition is False.
Args:
condition(bool): the condition. If True, raise AssertionErroron_error_msg(str): optional message for precising the error, in case of errorerror_type(Type[Exception]): the type of error to raise, if condition is not fulfilled. Default to AssertionError
function assert_not_reached
assert_not_reached(
on_error_msg: str,
error_type: Type[Exception] = <class 'AssertionError'>
)
Provide a custom assert to check that a piece of code is never reached.
Args:
on_error_msg(str): message for precising the errorerror_type(Type[Exception]): the type of error to raise, if condition is not fulfilled. Default to AssertionError