{"action":"created","comment":{"url":"https://api.github.com/repos/pytorch/pytorch/pulls/comments/234068762","pull_request_review_id":175632007,"id":234068762,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDA2ODc2Mg==","diff_hunk":"@@ -3,12 +3,15 @@\n from torch.nn.parameter import Parameter\n from .. import functional as F\n from .. import init\n+from ..._jit_internal import weak_module, weak_script_method\n \n \n # TODO: check contiguous in THNN\n # TODO: use separate backend functions?\n+@weak_module\n class _BatchNorm(Module):\n     _version = 2\n+    __constants__ = ['training', 'track_running_stats', 'momentum']","path":"torch/nn/modules/batchnorm.py","position":null,"original_position":12,"commit_id":"ae697259f91a37c48b2d64d0841c8419bf3d1f4d","original_commit_id":"2a308815c7ca27d9d9508bf1e98abfafaf070724","user":{"login":"wanchaol","id":9443650,"node_id":"MDQ6VXNlcjk0NDM2NTA=","avatar_url":"https://avatars2.githubusercontent.com/u/9443650?v=4","gravatar_id":"","url":"https://api.github.com/users/wanchaol","html_url":"https://github.com/wanchaol","followers_url":"https://api.github.com/users/wanchaol/followers","following_url":"https://api.github.com/users/wanchaol/following{/other_user}","gists_url":"https://api.github.com/users/wanchaol/gists{/gist_id}","starred_url":"https://api.github.com/users/wanchaol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanchaol/subscriptions","organizations_url":"https://api.github.com/users/wanchaol/orgs","repos_url":"https://api.github.com/users/wanchaol/repos","events_url":"https://api.github.com/users/wanchaol/events{/privacy}","received_events_url":"https://api.github.com/users/wanchaol/received_events","type":"User","site_admin":false},"body":"@soumith to be clear on this, this will only fail when users using JIT and making a call from `ScriptModule` then want to set `model.eval()`, it will not affect the python behaviors. ","created_at":"2018-11-16T01:51:19Z","updated_at":"2018-11-16T01:51:19Z","html_url":"https://github.com/pytorch/pytorch/pull/14016#discussion_r234068762","pull_request_url":"https://api.github.com/repos/pytorch/pytorch/pulls/14016","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/comments/234068762"},"html":{"href":"https://github.com/pytorch/pytorch/pull/14016#discussion_r234068762"},"pull_request":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/14016"}},"in_reply_to_id":233725028},"pull_request":{"url":"https://api.github.com/repos/pytorch/pytorch/pulls/14016","id":231081132,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMDgxMTMy","html_url":"https://github.com/pytorch/pytorch/pull/14016","diff_url":"https://github.com/pytorch/pytorch/pull/14016.diff","patch_url":"https://github.com/pytorch/pytorch/pull/14016.patch","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/14016","number":14016,"state":"open","locked":false,"title":"[jit] Export BatchNorm functional and module, add necessary JIT support","user":{"login":"wanchaol","id":9443650,"node_id":"MDQ6VXNlcjk0NDM2NTA=","avatar_url":"https://avatars2.githubusercontent.com/u/9443650?v=4","gravatar_id":"","url":"https://api.github.com/users/wanchaol","html_url":"https://github.com/wanchaol","followers_url":"https://api.github.com/users/wanchaol/followers","following_url":"https://api.github.com/users/wanchaol/following{/other_user}","gists_url":"https://api.github.com/users/wanchaol/gists{/gist_id}","starred_url":"https://api.github.com/users/wanchaol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanchaol/subscriptions","organizations_url":"https://api.github.com/users/wanchaol/orgs","repos_url":"https://api.github.com/users/wanchaol/repos","events_url":"https://api.github.com/users/wanchaol/events{/privacy}","received_events_url":"https://api.github.com/users/wanchaol/received_events","type":"User","site_admin":false},"body":"This PR did four things:\r\n\r\n1. It export the BatchNorm functional and module, and rewrite some of the components to stay align with the current supported JIT features\r\n2. In the process of export, add necessary compiler support for in_place op aug assign\r\n3. add list() op to support things like `list(a.size())`\r\n4. change the test_jit behavior in add_module_test to utilize a single rng state during module initialization","created_at":"2018-11-15T06:20:27Z","updated_at":"2018-11-16T01:51:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9843109d246b5dc48b385fd2d9914ffd226ccda","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":679953983,"node_id":"MDU6TGFiZWw2Nzk5NTM5ODM=","url":"https://api.github.com/repos/pytorch/pytorch/labels/jit","name":"jit","color":"c5def5","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pytorch/pytorch/pulls/14016/commits","review_comments_url":"https://api.github.com/repos/pytorch/pytorch/pulls/14016/comments","review_comment_url":"https://api.github.com/repos/pytorch/pytorch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/14016/comments","statuses_url":"https://api.github.com/repos/pytorch/pytorch/statuses/ae697259f91a37c48b2d64d0841c8419bf3d1f4d","head":{"label":"wanchaol:stdlib","ref":"stdlib","sha":"ae697259f91a37c48b2d64d0841c8419bf3d1f4d","user":{"login":"wanchaol","id":9443650,"node_id":"MDQ6VXNlcjk0NDM2NTA=","avatar_url":"https://avatars2.githubusercontent.com/u/9443650?v=4","gravatar_id":"","url":"https://api.github.com/users/wanchaol","html_url":"https://github.com/wanchaol","followers_url":"https://api.github.com/users/wanchaol/followers","following_url":"https://api.github.com/users/wanchaol/following{/other_user}","gists_url":"https://api.github.com/users/wanchaol/gists{/gist_id}","starred_url":"https://api.github.com/users/wanchaol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanchaol/subscriptions","organizations_url":"https://api.github.com/users/wanchaol/orgs","repos_url":"https://api.github.com/users/wanchaol/repos","events_url":"https://api.github.com/users/wanchaol/events{/privacy}","received_events_url":"https://api.github.com/users/wanchaol/received_events","type":"User","site_admin":false},"repo":{"id":136970431,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY5NzA0MzE=","name":"pytorch","full_name":"wanchaol/pytorch","private":false,"owner":{"login":"wanchaol","id":9443650,"node_id":"MDQ6VXNlcjk0NDM2NTA=","avatar_url":"https://avatars2.githubusercontent.com/u/9443650?v=4","gravatar_id":"","url":"https://api.github.com/users/wanchaol","html_url":"https://github.com/wanchaol","followers_url":"https://api.github.com/users/wanchaol/followers","following_url":"https://api.github.com/users/wanchaol/following{/other_user}","gists_url":"https://api.github.com/users/wanchaol/gists{/gist_id}","starred_url":"https://api.github.com/users/wanchaol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wanchaol/subscriptions","organizations_url":"https://api.github.com/users/wanchaol/orgs","repos_url":"https://api.github.com/users/wanchaol/repos","events_url":"https://api.github.com/users/wanchaol/events{/privacy}","received_events_url":"https://api.github.com/users/wanchaol/received_events","type":"User","site_admin":false},"html_url":"https://github.com/wanchaol/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":true,"url":"https://api.github.com/repos/wanchaol/pytorch","forks_url":"https://api.github.com/repos/wanchaol/pytorch/forks","keys_url":"https://api.github.com/repos/wanchaol/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wanchaol/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wanchaol/pytorch/teams","hooks_url":"https://api.github.com/repos/wanchaol/pytorch/hooks","issue_events_url":"https://api.github.com/repos/wanchaol/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/wanchaol/pytorch/events","assignees_url":"https://api.github.com/repos/wanchaol/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/wanchaol/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/wanchaol/pytorch/tags","blobs_url":"https://api.github.com/repos/wanchaol/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wanchaol/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wanchaol/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/wanchaol/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wanchaol/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/wanchaol/pytorch/languages","stargazers_url":"https://api.github.com/repos/wanchaol/pytorch/stargazers","contributors_url":"https://api.github.com/repos/wanchaol/pytorch/contributors","subscribers_url":"https://api.github.com/repos/wanchaol/pytorch/subscribers","subscription_url":"https://api.github.com/repos/wanchaol/pytorch/subscription","commits_url":"https://api.github.com/repos/wanchaol/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/wanchaol/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/wanchaol/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/wanchaol/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/wanchaol/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/wanchaol/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wanchaol/pytorch/merges","archive_url":"https://api.github.com/repos/wanchaol/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wanchaol/pytorch/downloads","issues_url":"https://api.github.com/repos/wanchaol/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/wanchaol/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/wanchaol/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/wanchaol/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wanchaol/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/wanchaol/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/wanchaol/pytorch/deployments","created_at":"2018-06-11T19:16:03Z","updated_at":"2018-10-12T06:39:32Z","pushed_at":"2018-11-16T01:42:22Z","git_url":"git://github.com/wanchaol/pytorch.git","ssh_url":"git@github.com:wanchaol/pytorch.git","clone_url":"https://github.com/wanchaol/pytorch.git","svn_url":"https://github.com/wanchaol/pytorch","homepage":"http://pytorch.org","size":85365,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytorch:master","ref":"master","sha":"37cb357d8da3427900b8f72f6de7e77b77dcdbae","user":{"login":"pytorch","id":21003710,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDAzNzEw","avatar_url":"https://avatars3.githubusercontent.com/u/21003710?v=4","gravatar_id":"","url":"https://api.github.com/users/pytorch","html_url":"https://github.com/pytorch","followers_url":"https://api.github.com/users/pytorch/followers","following_url":"https://api.github.com/users/pytorch/following{/other_user}","gists_url":"https://api.github.com/users/pytorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pytorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytorch/subscriptions","organizations_url":"https://api.github.com/users/pytorch/orgs","repos_url":"https://api.github.com/users/pytorch/repos","events_url":"https://api.github.com/users/pytorch/events{/privacy}","received_events_url":"https://api.github.com/users/pytorch/received_events","type":"Organization","site_admin":false},"repo":{"id":65600975,"node_id":"MDEwOlJlcG9zaXRvcnk2NTYwMDk3NQ==","name":"pytorch","full_name":"pytorch/pytorch","private":false,"owner":{"login":"pytorch","id":21003710,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIxMDAzNzEw","avatar_url":"https://avatars3.githubusercontent.com/u/21003710?v=4","gravatar_id":"","url":"https://api.github.com/users/pytorch","html_url":"https://github.com/pytorch","followers_url":"https://api.github.com/users/pytorch/followers","following_url":"https://api.github.com/users/pytorch/following{/other_user}","gists_url":"https://api.github.com/users/pytorch/gists{/gist_id}","starred_url":"https://api.github.com/users/pytorch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pytorch/subscriptions","organizations_url":"https://api.github.com/users/pytorch/orgs","repos_url":"https://api.github.com/users/pytorch/repos","events_url":"https://api.github.com/users/pytorch/events{/privacy}","received_events_url":"https://api.github.com/users/pytorch/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pytorch/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":false,"url":"https://api.github.com/repos/pytorch/pytorch","forks_url":"https://api.github.com/repos/pytorch/pytorch/forks","keys_url":"https://api.github.com/repos/pytorch/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytorch/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytorch/pytorch/teams","hooks_url":"https://api.github.com/repos/pytorch/pytorch/hooks","issue_events_url":"https://api.github.com/repos/pytorch/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/pytorch/pytorch/events","assignees_url":"https://api.github.com/repos/pytorch/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/pytorch/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/pytorch/pytorch/tags","blobs_url":"https://api.github.com/repos/pytorch/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytorch/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytorch/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytorch/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytorch/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/pytorch/pytorch/languages","stargazers_url":"https://api.github.com/repos/pytorch/pytorch/stargazers","contributors_url":"https://api.github.com/repos/pytorch/pytorch/contributors","subscribers_url":"https://api.github.com/repos/pytorch/pytorch/subscribers","subscription_url":"https://api.github.com/repos/pytorch/pytorch/subscription","commits_url":"https://api.github.com/repos/pytorch/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytorch/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytorch/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytorch/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytorch/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/pytorch/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytorch/pytorch/merges","archive_url":"https://api.github.com/repos/pytorch/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytorch/pytorch/downloads","issues_url":"https://api.github.com/repos/pytorch/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/pytorch/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/pytorch/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/pytorch/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytorch/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/pytorch/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/pytorch/pytorch/deployments","created_at":"2016-08-13T05:26:41Z","updated_at":"2018-11-16T01:38:54Z","pushed_at":"2018-11-16T01:49:40Z","git_url":"git://github.com/pytorch/pytorch.git","ssh_url":"git@github.com:pytorch/pytorch.git","clone_url":"https://github.com/pytorch/pytorch.git","svn_url":"https://github.com/pytorch/pytorch","homepage":"http://pytorch.org","size":88070,"stargazers_count":21258,"watchers_count":21258,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5058,"mirror_url":null,"archived":false,"open_issues_count":2122,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5058,"open_issues":2122,"watchers":21258,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/14016"},"html":{"href":"https://github.com/pytorch/pytorch/pull/14016"},"issue":{"href":"https://api.github.com/repos/pytorch/pytorch/issues/14016"},"comments":{"href":"https://api.github.com/repos/pytorch/pytorch/issues/14016/comments"},"review_comments":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/14016/comments"},"review_comment":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/14016/commits"},"statuses":{"href":"https://api.github.com/repos/pytorch/pytorch/statuses/ae697259f91a37c48b2d64d0841c8419bf3d1f4d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"wanchaol"}}