Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b74d91f

Browse filesBrowse files
authored
Fix bug in _take_channels (qubvel-org#148)
1 parent 81dd6a4 commit b74d91f
Copy full SHA for b74d91f

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎segmentation_models_pytorch/utils/functional.py

Copy file name to clipboardExpand all lines: segmentation_models_pytorch/utils/functional.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def _take_channels(*xs, ignore_channels=None):
66
return xs
77
else:
88
channels = [channel for channel in range(xs[0].shape[1]) if channel not in ignore_channels]
9-
xs = [torch.index_select(x, dim=1, index=torch.tensor(channels)) for x in xs]
9+
xs = [torch.index_select(x, dim=1, index=torch.tensor(channels).to(x.device)) for x in xs]
1010
return xs
1111

1212

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.