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
1dd2d66e
Unverified
Commit
1dd2d66e
authored
Jan 29, 2018
by
Francisco Massa
Committed by
GitHub
Jan 29, 2018
Browse files
Avoid division by zero in make_grid
Fixes
https://github.com/pytorch/vision/issues/397
parent
dac9efae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/utils.py
torchvision/utils.py
+1
-1
No files found.
torchvision/utils.py
View file @
1dd2d66e
...
@@ -52,7 +52,7 @@ def make_grid(tensor, nrow=8, padding=2,
...
@@ -52,7 +52,7 @@ def make_grid(tensor, nrow=8, padding=2,
def
norm_ip
(
img
,
min
,
max
):
def
norm_ip
(
img
,
min
,
max
):
img
.
clamp_
(
min
=
min
,
max
=
max
)
img
.
clamp_
(
min
=
min
,
max
=
max
)
img
.
add_
(
-
min
).
div_
(
max
-
min
)
img
.
add_
(
-
min
).
div_
(
max
-
min
+
1e-5
)
def
norm_range
(
t
,
range
):
def
norm_range
(
t
,
range
):
if
range
is
not
None
:
if
range
is
not
None
:
...
...
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