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
144f0980
"...text-generation-inference.git" did not exist on "895c5f15628df870f7a2ced7151dedb84231a996"
Unverified
Commit
144f0980
authored
Feb 16, 2022
by
vfdev
Committed by
GitHub
Feb 16, 2022
Browse files
Fixes device mismatch issue while building docs (#5428)
parent
8bf46d4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
torchvision/utils.py
torchvision/utils.py
+3
-2
No files found.
torchvision/utils.py
View file @
144f0980
...
@@ -449,8 +449,9 @@ def _normalized_flow_to_image(normalized_flow: torch.Tensor) -> torch.Tensor:
...
@@ -449,8 +449,9 @@ def _normalized_flow_to_image(normalized_flow: torch.Tensor) -> torch.Tensor:
"""
"""
N
,
_
,
H
,
W
=
normalized_flow
.
shape
N
,
_
,
H
,
W
=
normalized_flow
.
shape
flow_image
=
torch
.
zeros
((
N
,
3
,
H
,
W
),
dtype
=
torch
.
uint8
)
device
=
normalized_flow
.
device
colorwheel
=
_make_colorwheel
()
# shape [55x3]
flow_image
=
torch
.
zeros
((
N
,
3
,
H
,
W
),
dtype
=
torch
.
uint8
,
device
=
device
)
colorwheel
=
_make_colorwheel
().
to
(
device
)
# shape [55x3]
num_cols
=
colorwheel
.
shape
[
0
]
num_cols
=
colorwheel
.
shape
[
0
]
norm
=
torch
.
sum
(
normalized_flow
**
2
,
dim
=
1
).
sqrt
()
norm
=
torch
.
sum
(
normalized_flow
**
2
,
dim
=
1
).
sqrt
()
a
=
torch
.
atan2
(
-
normalized_flow
[:,
1
,
:,
:],
-
normalized_flow
[:,
0
,
:,
:])
/
torch
.
pi
a
=
torch
.
atan2
(
-
normalized_flow
[:,
1
,
:,
:],
-
normalized_flow
[:,
0
,
:,
:])
/
torch
.
pi
...
...
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