Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
d2f7486c
Unverified
Commit
d2f7486c
authored
May 19, 2023
by
Philip Meier
Committed by
GitHub
May 19, 2023
Browse files
convert torch.split return to list in RAFT (#7597)
parent
689ff292
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
torchvision/prototype/models/depth/stereo/raft_stereo.py
torchvision/prototype/models/depth/stereo/raft_stereo.py
+6
-1
No files found.
torchvision/prototype/models/depth/stereo/raft_stereo.py
View file @
d2f7486c
...
...
@@ -450,7 +450,12 @@ class RaftStereo(nn.Module):
hidden_state
,
context
=
torch
.
split
(
context_outs
[
i
],
[
hidden_dims
[
i
],
context_out_channels
[
i
]],
dim
=
1
)
hidden_states
.
append
(
torch
.
tanh
(
hidden_state
))
contexts
.
append
(
torch
.
split
(
context_conv
(
F
.
relu
(
context
)),
[
hidden_dims
[
i
],
hidden_dims
[
i
],
hidden_dims
[
i
]],
dim
=
1
)
# mypy is technically correct here. The return type of `torch.split` was incorrectly annotated with
# `List[int]` although it should have been `Tuple[Tensor, ...]`. However, the latter is not supported by
# JIT and thus we have to keep the wrong annotation here and silence mypy.
torch
.
split
(
# type: ignore[arg-type]
context_conv
(
F
.
relu
(
context
)),
[
hidden_dims
[
i
],
hidden_dims
[
i
],
hidden_dims
[
i
]],
dim
=
1
)
)
_
,
Cf
,
Hf
,
Wf
=
fmap1
.
shape
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment