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

Method is_valid

exir/_serialize/_program.py:232–237  ·  view source on GitHub ↗

Returns true if the extended header appears to be well-formed.

(self)

Source from the content-addressed store, hash-verified

230 )
231
232 def is_valid(self) -> bool:
233 """Returns true if the extended header appears to be well-formed."""
234 return (
235 self.magic == _ExtendedHeader.EXPECTED_MAGIC
236 and self.length >= _ExtendedHeader.MINIMUM_LENGTH
237 )
238
239 def to_bytes(self) -> bytes:
240 """Returns the binary representation of the extended header.

Calls

no outgoing calls