Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Further improvements of nn.container docs#17731

Closed
ssnl wants to merge 6 commits into
masterfrom
SsnL-patch-3
Closed

Further improvements of nn.container docs#17731
ssnl wants to merge 6 commits into
masterfrom
SsnL-patch-3

Conversation

@ssnl
Copy link
Copy Markdown
Collaborator

@ssnl ssnl commented Mar 6, 2019

No description provided.

or another :class:`~torch.nn.ParameterDict` (the argument to
:meth:`~torch.nn.ParameterDict.update`).

Note that :meth:`~torch.nn.ParameterDict.update` with other unordered mapping
Copy link
Copy Markdown
Contributor

@vishwakftw vishwakftw Mar 7, 2019

Choose a reason for hiding this comment

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

Could this be added in a note-block?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It sort of goes together with the previous paragraph, so I didn't make it a .. note::

@ssnl ssnl requested review from ezyang and zou3519 March 10, 2019 18:03
Comment thread torch/nn/modules/container.py Outdated
:meth:`~torch.nn.ParameterDict.update`).

Note that :meth:`~torch.nn.ParameterDict.update` with other unordered mapping
types (e.g., Python's plain ``dict``) doesn't not preserve order of the
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

doesn't not -> does not


if isinstance(parameters, container_abcs.Mapping):
if isinstance(parameters, OrderedDict):
if isinstance(parameters, (OrderedDict, ParameterDict)):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting, didn't know you could do this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yeah it takes in a tuple :D

Copy link
Copy Markdown
Contributor

@zou3519 zou3519 left a comment

Choose a reason for hiding this comment

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

One comment on something that looks like a typo. Otherwise, looks good to me

@ssnl
Copy link
Copy Markdown
Collaborator Author

ssnl commented Mar 10, 2019

@zou3519 Thanks! I've fixed the typo. Hopefully lint passes as I edited on github UI directly.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ssnl ssnl deleted the SsnL-patch-3 branch March 11, 2019 02:12
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary: Pull Request resolved: pytorch#17731

Differential Revision: D14401894

Pulled By: soumith

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants