Skip to content

Mismatch in docs and behavior of align_corners for nn.functional.interpolate #42729

@ORippler

Description

@ORippler

📚 Documentation

In the docs of nn.functional.interpolate it is stated that align_corners is a bool with default value False. Furthermore, it is stated that align_corners does not affect interpolation modes 'area' as well as 'nearest' .

If you look at the implementation however, default of align_corners is None. Furthermore, when passing a bool for align_corners together with interpolation modes 'nearest' or 'area' to nn.functional.interpolate, a ValueError is raised

There is thus a clear mismatch between docstrings and implemented behavior of align_corners in combination with modes 'nearest' and 'area' for nn.functional.interpolate. Based on the intended behvaior, either the code or the docstrings should be changed.

Related PR that introduced align_corners and may clarify originally intended behavior: #5927

I would vote for changing the code to adhere to the behavior outlined in the docstrings, and am up to fixing the issue regardless of the made decision.

cc @jlin27 @albanD @mruberry

Metadata

Metadata

Assignees

Labels

module: docsRelated to our documentation, both in docs/ and docblocksmodule: nnRelated to torch.nntriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions