Misleading documentation for module._load_from_state_dict (#17618)
authorKai Zhang <kaizh@fb.com>
Tue, 12 Mar 2019 23:52:38 +0000 (16:52 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 12 Mar 2019 23:57:39 +0000 (16:57 -0700)
commit4ad17c9031680dc4d5997bc4999ea4a93d33c8d0
tree6172d5ea4a13e17844f533c56d8b36be4992922d
parent6248266d911f180b1af43f48022efcf0ef29d733
Misleading documentation for module._load_from_state_dict (#17618)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17618

Base on the code, we only add key to `missing_keys` and `unexpected_keys` if `$strict` is `True`. The documentation is confusing.

This diff also fix one FLAKE8 warning.

Reviewed By: ailzhang

Differential Revision: D14280593

fbshipit-source-id: d368f5596bdf74ff62ee4d28d79120f5af91e0a3
torch/nn/modules/module.py