MCPcopy Create free account
hub / github.com/pytorch/executorch / internal_assert

Function internal_assert

exir/error.py:24–32  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

22
23
24def 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
35class InternalError(Exception):

Callers 8

_make_submoduleFunction · 0.90
lifetime_overlapMethod · 0.90
storage_overlapMethod · 0.90
collect_specs_from_nodesFunction · 0.90
memory_format_enumFunction · 0.90
scalar_type_enumFunction · 0.90
check_specFunction · 0.90
_set_alloc_node_specMethod · 0.90

Calls 1

InternalErrorClass · 0.85

Tested by

no test coverage detected