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

Function _flatc_decompile

exir/_serialize/_flatbuffer.py:355–384  ·  view source on GitHub ↗

Deserializes binary flatbuffer data to a JSON file. Args: output_dir: Directory under which to create the JSON file. schema_path: Path to the flatbuffer schema to use for deserialization. If the schema inclues other schema files, they must be present in t

(
    output_dir: str,
    schema_path: str,
    bin_path: str,
    flatc_additional_args: Optional[List[str]] = None,
)

Source from the content-addressed store, hash-verified

353
354
355def _flatc_decompile(
356 output_dir: str,
357 schema_path: str,
358 bin_path: str,
359 flatc_additional_args: Optional[List[str]] = None,
360) -> None:
361 """Deserializes binary flatbuffer data to a JSON file.
362
363 Args:
364 output_dir: Directory under which to create the JSON file.
365 schema_path: Path to the flatbuffer schema to use for deserialization.
366 If the schema inclues other schema files, they must be present in
367 the same directory.
368 bin_path: Path to the data to deserialize, as binary data compatible
369 with the schema.
370 """
371 flatc_additional_args = flatc_additional_args if flatc_additional_args else []
372 _run_flatc(
373 flatc_additional_args
374 + [
375 "--json",
376 "--defaults-json",
377 "--strict-json",
378 "-o",
379 output_dir,
380 schema_path,
381 "--",
382 bin_path,
383 ]
384 )
385
386
387def _program_json_to_flatbuffer(

Callers 6

flatbuffer_to_vk_graphFunction · 0.90
_convert_to_objectFunction · 0.90
convert_from_flatbufferFunction · 0.90
_convert_from_flatccFunction · 0.90

Calls 1

_run_flatcFunction · 0.70

Tested by

no test coverage detected