"tests/vscode:/vscode.git/clone" did not exist on "e22bd78fe052a9480c354cace98d98e08ed20bcc"
Unverified Commit 2875315d authored by eellison's avatar eellison Committed by GitHub
Browse files

fix len error (#1981)


Co-authored-by: default avatareellison <eellison@fb.com>
parent 7c077f6a
......@@ -77,12 +77,13 @@ 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:
raise ValueError(
"scale_factor shape must match input shape. "
"Input is {}D, scale_factor size is {}".format(dim, len(scale_factor))
)
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))
)
def _output_size(dim, input, size, scale_factor):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment