This is exir's custom assert method. It internally just throws InternalError. Note that the sole purpose is to throw our own error while maintaining similar syntax as python assert.
(pred: bool, assert_msg: str)
| 22 | |
| 23 | |
| 24 | def internal_assert(pred: bool, assert_msg: str) -> None: |
| 25 | """ |
| 26 | This is exir's custom assert method. It internally just throws InternalError. |
| 27 | Note that the sole purpose is to throw our own error while maintaining similar syntax |
| 28 | as python assert. |
| 29 | """ |
| 30 | |
| 31 | if not pred: |
| 32 | raise InternalError(assert_msg) |
| 33 | |
| 34 | |
| 35 | class InternalError(Exception): |
no test coverage detected