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

Method _prefix_key

backends/mlx/builder/program_builder.py:156–165  ·  view source on GitHub ↗

Apply the named-data key prefix for the .pte namespace. This is the single point where canonical (unprefixed) names are transformed into the external keys used in the .pte's ``named_data`` section and the FlatBuffer ``named_slots`` field.

(self, name: str)

Source from the content-addressed store, hash-verified

154 self._constant_name_to_slot: Dict[str, Slot] = {}
155
156 def _prefix_key(self, name: str) -> str:
157 """Apply the named-data key prefix for the .pte namespace.
158
159 This is the single point where canonical (unprefixed) names are
160 transformed into the external keys used in the .pte's ``named_data``
161 section and the FlatBuffer ``named_slots`` field.
162 """
163 if self._named_data_key_prefix:
164 return f"{self._named_data_key_prefix}/{name}"
165 return name
166
167 def emit(self, op: OpNodeUnion) -> None:
168 self._chains[self._current_chain].append(Instruction(op=op))

Callers 2

_build_io_mapsMethod · 0.95
get_named_data_storeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected