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

Method write_to_file

exir/program/_program.py:694–700  ·  view source on GitHub ↗

Writes the serialized ExecuTorch binary to the file at `open_file`. Prefer to use this over `buffer`, as it writes to file without copying into a contiguous block of memory first, reducing the peak memory usage.

(self, open_file: io.BufferedIOBase)

Source from the content-addressed store, hash-verified

692 return self.exported_program
693
694 def write_to_file(self, open_file: io.BufferedIOBase) -> None:
695 """
696 Writes the serialized ExecuTorch binary to the file at `open_file`. Prefer to use this over
697 `buffer`, as it writes to file without copying into a contiguous block of memory first,
698 reducing the peak memory usage.
699 """
700 self._get_pte_data().write_to_file(open_file)
701
702 def write_tensor_data_to_file(self, outdir) -> None:
703 """

Callers 3

write_to_fileMethod · 0.45

Calls 1

_get_pte_dataMethod · 0.95

Tested by

no test coverage detected