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

Function _get_extended_header

exir/_serialize/_program.py:268–276  ·  view source on GitHub ↗

Returns the extended header of the program data, if present and valid.

(program_data: bytes)

Source from the content-addressed store, hash-verified

266
267
268def _get_extended_header(program_data: bytes) -> Optional[_ExtendedHeader]:
269 """Returns the extended header of the program data, if present and valid."""
270 try:
271 eh = _ExtendedHeader.from_bytes(program_data[8:])
272 if eh.is_valid():
273 return eh
274 except ValueError:
275 pass
276 return None
277
278
279def _extract_delegate_segments(

Calls 2

from_bytesMethod · 0.45
is_validMethod · 0.45