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

Function _is_valid_alignment

exir/_serialize/_flatbuffer.py:29–33  ·  view source on GitHub ↗

Returns True if the alignment is valid, or is None.

(alignment: int)

Source from the content-addressed store, hash-verified

27
28
29def _is_valid_alignment(alignment: int) -> bool:
30 """Returns True if the alignment is valid, or is None."""
31 if alignment is None:
32 return True
33 return alignment > 0 and (alignment & (alignment - 1)) == 0
34
35
36def _patch_schema_alignment(

Callers 2

assert_valid_alignmentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected