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

Method write_to_file

exir/program/_program.py:2010–2016  ·  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

2008 return self._etrecord
2009
2010 def write_to_file(self, open_file: io.BufferedIOBase) -> None:
2011 """
2012 Writes the serialized ExecuTorch binary to the file at `open_file`. Prefer to use this over
2013 `buffer`, as it writes to file without copying into a contiguous block of memory first,
2014 reducing the peak memory usage.
2015 """
2016 self._pte_data.write_to_file(open_file)
2017
2018 def write_tensor_data_to_file(self, outdir) -> None:
2019 """

Callers 1

saveMethod · 0.95

Calls 1

write_to_fileMethod · 0.45

Tested by

no test coverage detected