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
2875315d
Unverified
Commit
2875315d
authored
Mar 16, 2020
by
eellison
Committed by
GitHub
Mar 16, 2020
Browse files
fix len error (#1981)
Co-authored-by:
eellison
<
eellison@fb.com
>
parent
7c077f6a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
torchvision/ops/misc.py
torchvision/ops/misc.py
+7
-6
No files found.
torchvision/ops/misc.py
View file @
2875315d
...
...
@@ -77,8 +77,9 @@ def _check_size_scale_factor(dim, size, scale_factor):
raise
ValueError
(
"either size or scale_factor should be defined"
)
if
size
is
not
None
and
scale_factor
is
not
None
:
raise
ValueError
(
"only one of size or scale_factor should be defined"
)
if
scale_factor
is
not
None
and
isinstance
(
scale_factor
,
tuple
)
\
and
len
(
scale_factor
)
!=
dim
:
if
scale_factor
is
not
None
:
if
isinstance
(
scale_factor
,
(
list
,
tuple
)):
if
len
(
scale_factor
)
!=
dim
:
raise
ValueError
(
"scale_factor shape must match input shape. "
"Input is {}D, scale_factor size is {}"
.
format
(
dim
,
len
(
scale_factor
))
...
...
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