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

Function extract_alignment

exir/_serialize/_flatbuffer.py:205–211  ·  view source on GitHub ↗
(schema: bytes, marker: bytes)

Source from the content-addressed store, hash-verified

203 raise ValueError("Missing file_identifier in schema files.")
204
205 def extract_alignment(schema: bytes, marker: bytes) -> int:
206 for line in schema.splitlines():
207 if marker in line:
208 match = re.search(rb"force_align\s*:\s*(\d+)", line)
209 if match:
210 return int(match.group(1))
211 raise RuntimeError(f"Failed to find marker {marker!r} in program.fbs")
212
213 program_schema_data = schemas.get(program_schema)
214 tensor_alignment = extract_alignment(

Callers 1

_prepare_schemaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected