{"action":"created","issue":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/2117","repository_url":"https://api.github.com/repos/pytorch/pytorch","labels_url":"https://api.github.com/repos/pytorch/pytorch/issues/2117/labels{/name}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/2117/comments","events_url":"https://api.github.com/repos/pytorch/pytorch/issues/2117/events","html_url":"https://github.com/pytorch/pytorch/issues/2117","id":243247518,"number":2117,"title":"Add dynamic infer shape for nn.Linear","user":{"login":"VoVAllen","id":8686776,"avatar_url":"https://avatars4.githubusercontent.com/u/8686776?v=4","gravatar_id":"","url":"https://api.github.com/users/VoVAllen","html_url":"https://github.com/VoVAllen","followers_url":"https://api.github.com/users/VoVAllen/followers","following_url":"https://api.github.com/users/VoVAllen/following{/other_user}","gists_url":"https://api.github.com/users/VoVAllen/gists{/gist_id}","starred_url":"https://api.github.com/users/VoVAllen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoVAllen/subscriptions","organizations_url":"https://api.github.com/users/VoVAllen/orgs","repos_url":"https://api.github.com/users/VoVAllen/repos","events_url":"https://api.github.com/users/VoVAllen/events{/privacy}","received_events_url":"https://api.github.com/users/VoVAllen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-07-16T15:39:58Z","updated_at":"2017-07-16T19:24:26Z","closed_at":"2017-07-16T16:00:43Z","body":"It's quite inconvenient for user to calculate the shape of tensor manually. I think it would be better to entitle nn.Linear with the ability to infer shape from the input tensor.\r\nOne possible solution is like numpy's reshape function, which is nn.Linear(-1, hidden_size) or nn.Linear(None, hidden_size) means automatic inferring.\r\n\r\nMy preliminary implementation for this is at here:\r\nhttps://gist.github.com/VoVAllen/1420e410e3dfd368b8dc9061ad0c206a\r\n\r\nThis implementation doesn't create any overhead during the training process. Also I think this kind of style can be used in other layers such as nn.Conv.\r\nFeel free to add any comments. "},"comment":{"url":"https://api.github.com/repos/pytorch/pytorch/issues/comments/315631034","html_url":"https://github.com/pytorch/pytorch/issues/2117#issuecomment-315631034","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/2117","id":315631034,"user":{"login":"VoVAllen","id":8686776,"avatar_url":"https://avatars4.githubusercontent.com/u/8686776?v=4","gravatar_id":"","url":"https://api.github.com/users/VoVAllen","html_url":"https://github.com/VoVAllen","followers_url":"https://api.github.com/users/VoVAllen/followers","following_url":"https://api.github.com/users/VoVAllen/following{/other_user}","gists_url":"https://api.github.com/users/VoVAllen/gists{/gist_id}","starred_url":"https://api.github.com/users/VoVAllen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoVAllen/subscriptions","organizations_url":"https://api.github.com/users/VoVAllen/orgs","repos_url":"https://api.github.com/users/VoVAllen/repos","events_url":"https://api.github.com/users/VoVAllen/events{/privacy}","received_events_url":"https://api.github.com/users/VoVAllen/received_events","type":"User","site_admin":false},"created_at":"2017-07-16T19:24:26Z","updated_at":"2017-07-16T19:24:26Z","body":"Get it. Thank you for your explanation. It's more complicated than I thought. Hogwild's behavior is more likely a static graph construction. However I still feel regret that a dynamic graph framework cannot implement such infer shape things."}}
{"actor":{"display_login":"VoVAllen"}}