Skip to content

Commit

Permalink
Update on "Update pipeline API to accept arbitrary sequence of Tensor…
Browse files Browse the repository at this point in the history
…s and not just Tuple"

The current API's forward method only accepted a Tensor or a Tuple of
Tensors, making this more generic by accepting any Sequence of Tensors.

Differential Revision: [D25181944](https://our.internmc.facebook.com/intern/diff/D25181944/)

[ghstack-poisoned]
  • Loading branch information
pritamdamania committed Dec 11, 2020
1 parent f7914c4 commit 9f84d16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/distributed/_pipeline/sync/microbatch.py
Expand Up @@ -110,7 +110,7 @@ def __setitem__(self, index: Union[int, slice], value: TensorOrTensors) -> None:
def _setitem_by_index(self, index: int, value: Tensor) -> None:
if not self.atomic:
i = index
self.value = self.value[:i] + (value,) + self.value[i + 1 :] #type: ignore
self.value = self.value[:i] + (value,) + self.value[i + 1 :] # type: ignore
return

if index != 0:
Expand Down

0 comments on commit 9f84d16

Please sign in to comment.