MCPcopy Create free account
hub / github.com/pytorch/pytorch / update_arg

Method update_arg

torch/fx/node.py:355–367  ·  view source on GitHub ↗

Update an existing positional argument to contain the new value ``arg``. After calling, ``self.args[idx] == arg``. Args: idx (int): The index into ``self.args`` of the element to update arg (Argument): The new argument value to write into ``args``

(self, idx : int, arg : Argument)

Source from the content-addressed store, hash-verified

353
354 @compatibility(is_backward_compatible=True)
355 def update_arg(self, idx : int, arg : Argument) -> None:
356 """
357 Update an existing positional argument to contain the new value
358 ``arg``. After calling, ``self.args[idx] == arg``.
359
360 Args:
361
362 idx (int): The index into ``self.args`` of the element to update
363 arg (Argument): The new argument value to write into ``args``
364 """
365 args = list(self.args)
366 args[idx] = arg
367 self.args = tuple(args)
368
369 @compatibility(is_backward_compatible=True)
370 def insert_arg(self, idx : int, arg : Argument) -> None:

Callers 7

partitionerFunction · 0.45
merge_splitsFunction · 0.45
merge_getitem_catFunction · 0.45
merge_stack_tahn_unbindFunction · 0.45
test_update_args_apiMethod · 0.45

Calls 1

listFunction · 0.85

Tested by 2

test_update_args_apiMethod · 0.36