Skip to content

Commit db49af4

Browse files
Jack-Khuufacebook-github-bot
authored andcommitted
Update docstring for DelegateMappingBuilder
Summary: Update annotation to reflect that the function is inserting and not appending Differential Revision: D49696156
1 parent 2500d3a commit db49af4

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

exir/backend/utils.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ def replace_quantized_partition_with_op(
168168
# TODO - style: use templated types
169169
class DelegateMappingBuilder:
170170
"""
171-
Profiling helper class for building Delegate Maps.
172-
Delegate Maps are a mapping from log entry identifiers to node
171+
Profiling helper class for building Delegate Mappings.
172+
Delegate Mappings are mappings from delegate debug identifiers to node
173173
debug handles. Specifically this is used to log within backend delegates
174174
175175
Args:
176-
generated_identifiers (bool, optional): Whether delegate map keys are
176+
generated_identifiers (bool, optional): Whether identifier keys are
177177
generated automatically. Defaults to False.
178178
"""
179179

@@ -206,27 +206,23 @@ def insert_delegate_mapping_entry(
206206
identifier: Optional[Union[int, str]] = None,
207207
) -> Union[int, str]:
208208
"""
209-
Add or append to an existing delegate mapping entry
209+
Add a new delegate mapping entry
210210
211211
If self._generated_identifiers = False:
212-
- An identifier must be provided, else this is no-op
212+
- A new identifier must be provided, else an exception is thrown
213213
214214
If self._generated_identifiers = True:
215-
- NEW identifiers cannot be manually provided. Existing identifier
216-
can be provided
217215
- New identifiers are generated incrementally, 0 indexed
218-
219-
If a provided identifier already exists, node entries are appended
216+
- Identifiers cannot be manually provided, else an exception is thrown
220217
221218
Args:
222219
nodes (Union[Node, List[Node]]): A (list of) Node(s)
223220
identifier (Optional[Union[int, str]]):
224221
Debug identifier corresponding to the Node(s)
225222
226223
Returns:
227-
Optional[Union[int, str]]:
228-
Delegate debug identifier corresponding to the node group
229-
None is returned, if no identifier is associated
224+
Union[int, str]:
225+
Delegate debug identifier inserted
230226
"""
231227

232228
# Check for manual addition of identifier (with generated identifiers enabled)

0 commit comments

Comments
 (0)