Skip to content

Commit ea4a187

Browse files
authored
Fix non-existing docstring parameters (#4827)
1 parent c7aff77 commit ea4a187

File tree

13 files changed

+26
-34
lines changed

13 files changed

+26
-34
lines changed

backends/apple/mps/operators/node_visitor.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def define_tensor(
7777
"""Defines a tensor value into the MPSGraph serialization schema
7878
7979
Args:
80-
tensor (torch.fx.Node): EdgeIR tensor to define into mps_graph
80+
node (torch.fx.Node): EdgeIR tensor to define into mps_graph
8181
mps_graph (MPSGraph): MPSGraph object for serializing into flatbuffer
8282
"""
8383

@@ -155,7 +155,7 @@ def define_constant(
155155
"""Defines a scalar value into the MPSGraph serialization schema
156156
157157
Args:
158-
tensor (torch.fx.Node): EdgeIR tensor to define into mps_graph
158+
constant_tensor (torch.fx.Node): EdgeIR tensor to define into mps_graph
159159
mps_graph (MPSGraph): MPSGraph object for serializing into flatbuffer
160160
"""
161161
constant_tensor = constant_tensor.contiguous()
@@ -191,7 +191,6 @@ def define_scalar(
191191
"""Defines a scalar value into the MPSGraph serialization schema
192192
193193
Args:
194-
tensor (torch.fx.Node): EdgeIR tensor to define into mps_graph
195194
mps_graph (MPSGraph): MPSGraph object for serializing into flatbuffer
196195
"""
197196
assert isinstance(val, int) or isinstance(val, float)
@@ -229,7 +228,7 @@ def get_serialized_buffer(
229228
index of its placement in the constant buffer
230229
231230
Args:
232-
tensor (torch.fx.Node): _description_
231+
node (torch.fx.Node): _description_
233232
mps_graph (MPSGraph): _description_
234233
235234
Returns:
@@ -299,7 +298,7 @@ def get_serialized_id(
299298
the existent id.
300299
301300
Args:
302-
tensor (Union[torch.fx.Node, float]): _description_
301+
node (Union[torch.fx.Node, float]): _description_
303302
mps_graph (MPSGraph): _description_
304303
305304
Returns:

backends/apple/mps/utils/mps_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def is_parameter(exp_prog: torch.export.ExportedProgram, node: torch.fx.Node) ->
7373
are supplied as inputs to the graph.
7474
7575
Args:
76-
edge_program (torch.export.ExportedProgram): _description_
76+
exp_prog (torch.export.ExportedProgram): _description_
7777
node (torch.fx.Node): _description_
7878
7979
Returns:

backends/arm/test/runner_utils.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,10 @@ def run_tosa_ref_model(
275275
inputs: Tuple[torch.Tensor],
276276
) -> list[torch.Tensor]:
277277
"""
278-
Run TOSA reference model using the tosa_refence_model program.
278+
Run TOSA reference model using the tosa_reference_model program.
279279
280280
In order to do that we need:
281-
1. desc.json, which points to files needed by tosa_refence_model.
281+
1. desc.json, which points to files needed by tosa_reference_model.
282282
2. output.tosa, which is the TOSA buffer that describes the model we're
283283
trying to run.
284284
@@ -287,12 +287,6 @@ def run_tosa_ref_model(
287287
All these files are saved on disk in self.intermediate_path.
288288
289289
Args:
290-
params_input (Tuple[List[str], List[QuantizationParams]]): A tuple
291-
containing a list of input node names and a list of their
292-
quantization parameters (if model is quantized).
293-
param_output (Tuple[str, QuantizationParams]): A tuple containing
294-
the output node name and its quantization parameters (if
295-
model is quantized).
296290
inputs (Tuple[torch.Tensor]): The input data to run the TOSA
297291
298292
Returns:
@@ -423,7 +417,7 @@ def save_npy(
423417
Parameters:
424418
path: the directory where to save the data.
425419
data: the data to save.
426-
is_quantize: whether to quantize the data before saving it.
420+
is_quantized: whether to quantize the data before saving it.
427421
input_name: the name of the file, without file-ending.
428422
quant_param: the parameters to use for quantization.
429423
Returns:
@@ -448,7 +442,7 @@ def save_bytes(
448442
Parameters:
449443
path: the directory where to save the data.
450444
data: the data to save.
451-
is_quantize: whether to quantize the data before saving it.
445+
is_quantized: whether to quantize the data before saving it.
452446
input_name: the name of the file, without file-ending.
453447
quant_param: the parameters to use for quantization.
454448
Returns:

backends/cadence/aot/quantizer/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def get_aten_node_target_partitions(
145145
"""
146146
Args:
147147
graph: The graph we want to partition
148-
wanted_sources: List of orginal_aten ops (OpOverload)
148+
wanted_original_aten_op: List of original_aten ops (OpOverload)
149149
150150
Returns:
151151
Dictionary mapping aten ops that were given to a list of SourcePartitions

examples/models/llama2/evaluate/eager_eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def evaluate_model(
9999
100100
Args:
101101
eval_wrapper (LM): A LM wrapper class compatible with lm-evaluation-harness evaluation
102-
task (str): The name of the evaluation task to perform.
102+
tasks: Optional[list]: The names of the evaluation tasks to perform.
103103
limit (Optional[int]): The maximum number of samples to evaluate (None for all available).
104104
105105
Returns:

examples/models/llama2/tokenizer/tiktoken.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ def encode(
116116
s (str): The input string to be encoded.
117117
bos (bool): Whether to prepend the beginning-of-sequence token.
118118
eos (bool): Whether to append the end-of-sequence token.
119-
allowed_tokens ("all"|set[str]): allowed special tokens in string
120-
disallowed_tokens ("all"|set[str]): special tokens that raise an error when in string
119+
allowed_special ("all"|set[str]): allowed special tokens in string
120+
disallowed_special ("all"|set[str]): special tokens that raise an error when in string
121121
122122
Returns:
123123
list[int]: A list of token IDs.
124124
125125
By default, setting disallowed_special=() encodes a string by ignoring
126126
special tokens. Specifically:
127127
- Setting `disallowed_special` to () will cause all text corresponding
128-
to special tokens to be encoded as natural text (insteading of raising
128+
to special tokens to be encoded as natural text (instead of raising
129129
an error).
130130
- Setting `allowed_special` to "all" will treat all text corresponding
131131
to special tokens to be encoded as special tokens.

examples/qualcomm/oss_scripts/ssd300_vgg16.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def create_data_lists(voc07_path, data_size):
2828
Create lists of images, the bounding boxes and labels of the objects in these images, and save these to file.
2929
3030
:param voc07_path: path to the 'VOC2007' folder
31-
:param output_folder: folder where the JSONs must be saved
3231
"""
3332
from utils import parse_annotation
3433

examples/sdk/scripts/export_bundled_program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def save_bundled_program(
3737
Generates a bundled program from the given ET program and saves it to the specified path.
3838
3939
Args:
40-
program: The ExecuTorch program to bundle.
40+
executorch_program: The ExecuTorch program to bundle.
4141
method_test_suites: The MethodTestSuites which contains test cases to include in the bundled program.
4242
output_path: Path to save the bundled program.
4343
"""

extension/gguf_util/converters/llama_converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def convert_to_pte(gguf_model_args: GGUFModelArgs, gguf_weights: GGUFWeights) ->
9999
"""Convert a GGUF model into an ExecuTorch program.
100100
101101
Args:
102-
model_args: The arguments for the GGUF model.
103-
weights: The weights of the GGUF model.
102+
gguf_model_args: The arguments for the GGUF model.
103+
gguf_weights: The weights of the GGUF model.
104104
"""
105105

106106
assert (

extension/llm/export/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def to_backend(self, partitioners: Optional[List[Partitioner]]) -> "LLMEdgeManag
227227
Partition the model and lower to different backends. The signature is
228228
aligned with the signature of `to_backend` method of EdgeManager.
229229
Args:
230-
partitioner (Optional[Partitioner]): One or more
230+
partitioners (Optional[List[Partitioner]]): One or more
231231
partitioner to be sent to EdgeManager.to_backend().
232232
"""
233233
if partitioners is None:

sdk/bundled_program/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"""
4040
All supported types for input/expected output of MethodTestCase.
4141
42-
Namedtuple is also supported and listed implicity since it is a subclass of tuple.
42+
Namedtuple is also supported and listed implicitly since it is a subclass of tuple.
4343
"""
4444

4545
# pyre-ignore
@@ -59,23 +59,23 @@ def __init__(
5959
"""Single test case for verifying specific method
6060
6161
Args:
62-
input: All inputs required by eager_model with specific inference method for one-time execution.
62+
inputs: All inputs required by eager_model with specific inference method for one-time execution.
6363
6464
It is worth mentioning that, although both bundled program and ET runtime apis support setting input
6565
other than `torch.tensor` type, only the input in `torch.tensor` type will be actually updated in
6666
the method, and the rest of the inputs will just do a sanity check if they match the default value in method.
6767
68-
expected_output: Expected output of given input for verification. It can be None if user only wants to use the test case for profiling.
68+
expected_outputs: Expected output of given input for verification. It can be None if user only wants to use the test case for profiling.
6969
7070
Returns:
7171
self
7272
"""
7373
# TODO(gasoonjia): Update type check logic.
74-
# pyre-ignore [6]: Misalign data type for between MethodTestCase attribute and sannity check.
74+
# pyre-ignore [6]: Misalign data type for between MethodTestCase attribute and sanity check.
7575
self.inputs: List[ConfigValue] = self._flatten_and_sanity_check(inputs)
7676
self.expected_outputs: List[ConfigValue] = []
7777
if expected_outputs is not None:
78-
# pyre-ignore [6]: Misalign data type for between MethodTestCase attribute and sannity check.
78+
# pyre-ignore [6]: Misalign data type for between MethodTestCase attribute and sanity check.
7979
self.expected_outputs = self._flatten_and_sanity_check(expected_outputs)
8080

8181
def _flatten_and_sanity_check(

sdk/bundled_program/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def _assert_valid_bundle(
230230
Other checks not related to correspondence are done in config.py
231231
232232
Args:
233-
program: The program to be bundled.
233+
executorch_program: The program to be bundled.
234234
method_test_suites: The testcases for specific methods to be bundled.
235235
"""
236236

sdk/etrecord/_etrecord.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ def generate_etrecord(
185185
for SDK tooling usage.
186186
187187
Args:
188-
etrecord_path: Path to where the `ETRecord` file will be saved to.
188+
et_record: Path to where the `ETRecord` file will be saved to.
189189
edge_dialect_program: `EdgeProgramManager` for this model returned by the call to to_edge()
190190
executorch_program: The ExecuTorch program for this model returned by the call to `to_executorch()` or the `BundledProgram` of this model
191-
export_modules[Optional]: **Should be ignored by OSS users**. A dictionary of graph modules with the key being the user provided name and the
191+
export_modules [Optional]: **Should be ignored by OSS users**. A dictionary of graph modules with the key being the user provided name and the
192192
value being the corresponding exported module. The exported graph modules can be either the
193193
output of `torch.export()` or `exir.to_edge()`.
194194

0 commit comments

Comments
 (0)