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

Method patch_files

exir/_serialize/_flatbuffer.py:133–139  ·  view source on GitHub ↗

Uses the provided patching function to update the contents of all files. `patch_fn` takes the current contents of a file as input and returns the new contents.

(self, patch_fn: Callable[[bytes], bytes])

Source from the content-addressed store, hash-verified

131 self._files[name] = importlib.resources.read_binary(__package__, name)
132
133 def patch_files(self, patch_fn: Callable[[bytes], bytes]) -> None:
134 """Uses the provided patching function to update the contents of all
135 files. `patch_fn` takes the current contents of a file as input and
136 returns the new contents.
137 """
138 for name in self._files.keys():
139 self._files[name] = patch_fn(self._files[name])
140
141 def get(self, name: str) -> bytes:
142 """Returns the current contents of the named file."""

Callers 2

_prepare_schemaFunction · 0.80

Calls 1

keysMethod · 0.80

Tested by 1