KEMBAR78
DOC Small rewrite of interpolate recompute_scale_factor docstring by thomasjpfan · Pull Request #58989 · pytorch/pytorch · GitHub
Skip to content

Conversation

@thomasjpfan
Copy link
Contributor

Fixes #55909

This PR looks to improve the documentation to describe the following behavior:

pytorch/torch/nn/functional.py

Lines 3673 to 3685 in 8130f2f

if recompute_scale_factor is not None and recompute_scale_factor:
# We compute output_size here, then un-set scale_factors.
# The C++ code will recompute it based on the (integer) output size.
if not torch.jit.is_scripting() and torch._C._get_tracing_state():
# make scale_factor a tensor in tracing so constant doesn't get baked in
output_size = [
(torch.floor((input.size(i + 2).float() * torch.tensor(scale_factors[i], dtype=torch.float32)).float()))
for i in range(dim)
]
else:
assert scale_factors is not None
output_size = [int(math.floor(float(input.size(i + 2)) * scale_factors[i])) for i in range(dim)]
scale_factors = None

@thomasjpfan thomasjpfan added module: docs Related to our documentation, both in docs/ and docblocks module: nn Related to torch.nn triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels May 26, 2021
@thomasjpfan thomasjpfan requested a review from jbschlosser May 26, 2021 15:53
@thomasjpfan thomasjpfan requested a review from albanD as a code owner May 26, 2021 15:53
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented May 26, 2021

💊 CI failures summary and remediations

As of commit 59c3807 (more details on the Dr. CI page):


  • 4/4 failures possibly* introduced in this PR
    • 1/4 non-scanned failure(s)

🕵️ 3 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_linux_xenial_py3_6_gcc5_4_build (1/3)

Step: "(Optional) Merge target branch" (full log | diagnosis details | 🔁 rerun)

Automatic merge failed; fix conflicts and then commit the result.
CONFLICT (add/add): Merge conflict in .circleci/cimodel/data/dimensions.py
Auto-merging .circleci/cimodel/data/dimensions.py
CONFLICT (add/add): Merge conflict in .circleci/cimodel/data/binary_build_data.py
Auto-merging .circleci/cimodel/data/binary_build_data.py
CONFLICT (add/add): Merge conflict in .azure_pipelines/pytorch-tests-pipeline.yml
Auto-merging .azure_pipelines/pytorch-tests-pipeline.yml
CONFLICT (add/add): Merge conflict in .azure_pipelines/job_templates/wheel-wait-template.yml
Auto-merging .azure_pipelines/job_templates/wheel-wait-template.yml
CONFLICT (add/add): Merge conflict in .azure_pipelines/job_templates/wheel-wait-job-template.yml
Auto-merging .azure_pipelines/job_templates/wheel-wait-job-template.yml
Automatic merge failed; fix conflicts and then commit the result.


Exited with code exit status 1

See CircleCI build pytorch_xla_linux_bionic_py3_6_clang9_build (2/3)

Step: "(Optional) Merge target branch" (full log | diagnosis details | 🔁 rerun)

Automatic merge failed; fix conflicts and then commit the result.
CONFLICT (add/add): Merge conflict in .circleci/cimodel/data/dimensions.py
Auto-merging .circleci/cimodel/data/dimensions.py
CONFLICT (add/add): Merge conflict in .circleci/cimodel/data/binary_build_data.py
Auto-merging .circleci/cimodel/data/binary_build_data.py
CONFLICT (add/add): Merge conflict in .azure_pipelines/pytorch-tests-pipeline.yml
Auto-merging .azure_pipelines/pytorch-tests-pipeline.yml
CONFLICT (add/add): Merge conflict in .azure_pipelines/job_templates/wheel-wait-template.yml
Auto-merging .azure_pipelines/job_templates/wheel-wait-template.yml
CONFLICT (add/add): Merge conflict in .azure_pipelines/job_templates/wheel-wait-job-template.yml
Auto-merging .azure_pipelines/job_templates/wheel-wait-job-template.yml
Automatic merge failed; fix conflicts and then commit the result.


Exited with code exit status 1

See CircleCI build pytorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_build (3/3)

Step: "Build" (full log | diagnosis details | 🔁 rerun)

Jun 04 15:36:42 rm: cannot remove '/var/lib/jenkins/sccache_error.log': No such file or directory
Jun 04 15:36:42 ++++ extract_trap_cmd
Jun 04 15:36:42 ++++ printf '%s\n' ''
Jun 04 15:36:42 +++ printf '%s\n' cleanup
Jun 04 15:36:42 ++ trap -- '
Jun 04 15:36:42 cleanup' EXIT
Jun 04 15:36:42 ++ [[ pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7-build != *pytorch-win-* ]]
Jun 04 15:36:42 ++ which sccache
Jun 04 15:36:42 ++ sccache --stop-server
Jun 04 15:36:42 ++ true
Jun 04 15:36:42 ++ rm /var/lib/jenkins/sccache_error.log
Jun 04 15:36:42 rm: cannot remove '/var/lib/jenkins/sccache_error.log': No such file or directory
Jun 04 15:36:42 ++ true
Jun 04 15:36:42 ++ [[ -n '' ]]
Jun 04 15:36:42 ++ [[ pytorch-linux-xenial-cuda11.1-cudnn8-py3-gcc7-build == *rocm* ]]
Jun 04 15:36:42 ++ SCCACHE_ERROR_LOG=/var/lib/jenkins/sccache_error.log
Jun 04 15:36:42 ++ SCCACHE_IDLE_TIMEOUT=1200
Jun 04 15:36:42 ++ RUST_LOG=sccache::server=error
Jun 04 15:36:42 ++ sccache --start-server
Jun 04 15:36:42 sccache: Starting the server...
Jun 04 15:36:42 ++ sccache --zero-stats
Jun 04 15:36:42 Compile requests                      0

1 job timed out:

  • pytorch_linux_xenial_cuda11_1_cudnn8_py3_gcc7_build

ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@thomasjpfan thomasjpfan force-pushed the interpolate_recompute_scale_factor_fix branch from 32d24cb to 593662f Compare May 26, 2021 15:55
Copy link
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update! Your version explains what's going on much better :) I have to admit it's a fairly confusing arg in general.

Copy link
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@facebook-github-bot
Copy link
Contributor

@jbschlosser has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@jbschlosser merged this pull request in 8693e28.

deniskokarev pushed a commit to deniskokarev/pytorch that referenced this pull request Jun 9, 2021
…torch#58989)

Summary:
Fixes pytorch#55909

This PR looks to improve the documentation to describe the following behavior:

https://github.com/pytorch/pytorch/blob/8130f2f67ada1951ee27e55b8a506d6de23c13df/torch/nn/functional.py#L3673-L3685

Pull Request resolved: pytorch#58989

Reviewed By: ejguan

Differential Revision: D28931879

Pulled By: jbschlosser

fbshipit-source-id: d1140ebe1631c5ec75f135c2907daea19499f21a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged module: docs Related to our documentation, both in docs/ and docblocks module: nn Related to torch.nn open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F.interpolate recompute_scale_factor doc is bad

4 participants