Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions monai/networks/trt_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ def parse_groups(
Tuple of Union[torch.Tensor, List[torch.Tensor]], according to the grouping in output_lists

"""
groups: tuple[torch.Tensor | list[torch.Tensor], ...] = tuple()
groups: tuple[torch.Tensor | list[torch.Tensor], ...] = ()
cur = 0
for l in range(len(output_lists)):
gl = output_lists[l]
for idx in range(len(output_lists)):
gl = output_lists[idx]
assert len(gl) == 0 or len(gl) == 1
if len(gl) == 0 or gl[0] == 0:
groups = (*groups, ret[cur])
Expand All @@ -273,9 +273,9 @@ def parse_groups(
groups = (*groups, ret[cur : cur + gl[0]])
cur = cur + gl[0]
elif gl[0] == -1:
rev_groups: tuple[torch.Tensor | list[torch.Tensor], ...] = tuple()
rev_groups: tuple[torch.Tensor | list[torch.Tensor], ...] = ()
rcur = len(ret)
for rl in range(len(output_lists) - 1, l, -1):
for rl in range(len(output_lists) - 1, idx, -1):
rgl = output_lists[rl]
assert len(rgl) == 0 or len(rgl) == 1
if len(rgl) == 0 or rgl[0] == 0:
Expand Down
Loading