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

Function padding_required

exir/_serialize/padding.py:29–34  ·  view source on GitHub ↗

Returns the padding required to align `offset` to `alignment`.

(offset: int, alignment: int)

Source from the content-addressed store, hash-verified

27
28
29def padding_required(offset: int, alignment: int) -> int:
30 """Returns the padding required to align `offset` to `alignment`."""
31 remainder: int = offset % alignment
32 if remainder != 0:
33 return alignment - remainder
34 return 0
35
36
37def aligned_size(input_size: int, alignment: int) -> int:

Callers 4

serialize_pte_binaryFunction · 0.90
serializeMethod · 0.90
aligned_sizeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected