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

Method write_tensor_data_to_file

exir/program/_program.py:702–711  ·  view source on GitHub ↗

Writes the serialized ExecuTorch data files to the directory at `outdir`.

(self, outdir)

Source from the content-addressed store, hash-verified

700 self._get_pte_data().write_to_file(open_file)
701
702 def write_tensor_data_to_file(self, outdir) -> None:
703 """
704 Writes the serialized ExecuTorch data files to the directory at `outdir`.
705 """
706 assert self._tensor_data is not None
707 # pyre-ignore[16]: `Optional` has no attribute `items`.
708 for filename, cord in self._tensor_data.items():
709 with open(os.path.join(outdir, f"{filename}.ptd"), "wb") as f:
710 logging.info(f"Writing data file to {filename}.ptd")
711 cord.write_to_file(f)
712
713
714def _get_aten_to_edge_passes(config: EdgeCompileConfig):

Callers 15

mainFunction · 0.45
mainFunction · 0.45
_export_tq4_attnFunction · 0.45
_run_et_aotiFunction · 0.45
export_fused_moeFunction · 0.45
_export_pybindFunction · 0.45
export_chunk_gated_deltaFunction · 0.45
export_topkFunction · 0.45
_export_cudaFunction · 0.45
_export_mlxFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 3

itemsMethod · 0.80
infoMethod · 0.80
write_to_fileMethod · 0.45

Tested by 6

_export_tq4_attnFunction · 0.36
_run_et_aotiFunction · 0.36
export_fused_moeFunction · 0.36
_export_pybindFunction · 0.36
export_chunk_gated_deltaFunction · 0.36
export_topkFunction · 0.36