8000 [BE]: Improve typing in torch/modules/container.py · pytorch/pytorch@16c4619 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16c4619

Browse files
committed
[BE]: Improve typing in torch/modules/container.py
1 parent 8ca985b commit 16c4619

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/nn/modules/container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def __init__(self, *args):
121121
for idx, module in enumerate(args):
122122
self.add_module(str(idx), module)
123123

124-
def _get_item_by_idx(self, iterator, idx) -> T: # type: ignore[misc, type-var]
124+
def _get_item_by_idx(self, iterator: Iterable[T], idx: int) -> T: # type: ignore[misc, type-var]
125125
"""Get the idx-th item of the iterator."""
126126
size = len(self)
127127
idx = operator.index(idx)
@@ -298,7 +298,7 @@ def insert(self, index: int, module: Module) -> Self:
298298
self._modules[str(index)] = module
299299
return self
300300

301-
def extend(self, sequential) -> Self:
301+
def extend(self, sequential: Iterable[Module]) -> Self:
302302
"""
303303
Extends the current Sequential container with layers from another Sequential container.
304304

0 commit comments

Comments
 (0)
0