{"action":"created","comment":{"url":"https://api.github.com/repos/pytorch/pytorch/pulls/comments/145732982","pull_request_review_id":70576428,"id":145732982,"diff_hunk":"@@ -104,6 +107,8 @@ def _accumulate(iterable, fn=lambda x, y: x + y):\n def _flatten_tensors(tensors):\n     \"\"\"Flatten tensors into a single contiguous 1D buffer\"\"\"\n     if len(tensors) == 1:","path":"torch/_utils.py","position":15,"original_position":15,"commit_id":"e323933c5f24a6c53ed68f474c436f84fa37d257","original_commit_id":"e323933c5f24a6c53ed68f474c436f84fa37d257","user":{"login":"SsnL","id":5674597,"avatar_url":"https://avatars2.githubusercontent.com/u/5674597?v=4","gravatar_id":"","url":"https://api.github.com/users/SsnL","html_url":"https://github.com/SsnL","followers_url":"https://api.github.com/users/SsnL/followers","following_url":"https://api.github.com/users/SsnL/following{/other_user}","gists_url":"https://api.github.com/users/SsnL/gists{/gist_id}","starred_url":"https://api.github.com/users/SsnL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SsnL/subscriptions","organizations_url":"https://api.github.com/users/SsnL/orgs","repos_url":"https://api.github.com/users/SsnL/repos","events_url":"https://api.github.com/users/SsnL/events{/privacy}","received_events_url":"https://api.github.com/users/SsnL/received_events","type":"User","site_admin":false},"body":"The way the code works now is that when sparse tensors are given to `_flatten_tensor`, `tensors` will only be a single sparse tensor. I will update the comment on this!","created_at":"2017-10-19T15:18:40Z","updated_at":"2017-10-19T15:18:40Z","html_url":"https://github.com/pytorch/pytorch/pull/3178#discussion_r145732982","pull_request_url":"https://api.github.com/repos/pytorch/pytorch/pulls/3178","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/comments/145732982"},"html":{"href":"https://github.com/pytorch/pytorch/pull/3178#discussion_r145732982"},"pull_request":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/3178"}},"in_reply_to_id":145732384},"pull_request":{"url":"https://api.github.com/repos/pytorch/pytorch/pulls/3178","id":147579201,"html_url":"https://github.com/pytorch/pytorch/pull/3178","diff_url":"https://github.com/pytorch/pytorch/pull/3178.diff","patch_url":"https://github.com/pytorch/pytorch/pull/3178.patch","issue_url":"https://api.github.com/repos/pytorch/pytorch/issues/3178","number":3178,"state":"open","locked":false,"title":"Make sparse tensors work with reduce_add_coalesced and broadcast_coalesced","user":{"login":"SsnL","id":5674597,"avatar_url":"https://avatars2.githubusercontent.com/u/5674597?v=4","gravatar_id":"","url":"https://api.github.com/users/SsnL","html_url":"https://github.com/SsnL","followers_url":"https://api.github.com/users/SsnL/followers","following_url":"https://api.github.com/users/SsnL/following{/other_user}","gists_url":"https://api.github.com/users/SsnL/gists{/gist_id}","starred_url":"https://api.github.com/users/SsnL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SsnL/subscriptions","organizations_url":"https://api.github.com/users/SsnL/orgs","repos_url":"https://api.github.com/users/SsnL/repos","events_url":"https://api.github.com/users/SsnL/events{/privacy}","received_events_url":"https://api.github.com/users/SsnL/received_events","type":"User","site_admin":false},"body":"As a result, sparse tensors now work with data_parallel. Fixes #1456 .\r\n\r\nCommit structure:\r\n1. Add support for sparse tensors in various places for `add_coalesced` and `broadcast_coalesced`.\r\n2. Fix `_type` not working properly on sparse. Previously it didn't convert indices tensor when converted between cuda and cpu.\r\n3. Add test in `test_cuda.py`.\r\n4. Fix `pynew` `AutoGPU` arguments.\r\n\r\n","created_at":"2017-10-19T14:53:20Z","updated_at":"2017-10-19T15:18:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67da1d6b6cafde8065736b418d90c63d6725f696","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/pytorch/pytorch/pulls/3178/commits","review_comments_url":"https://api.github.com/repos/pytorch/pytorch/pulls/3178/comments","review_comment_url":"https://api.github.com/repos/pytorch/pytorch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytorch/pytorch/issues/3178/comments","statuses_url":"https://api.github.com/repos/pytorch/pytorch/statuses/e323933c5f24a6c53ed68f474c436f84fa37d257","head":{"label":"SsnL:sparse_dp","ref":"sparse_dp","sha":"e323933c5f24a6c53ed68f474c436f84fa37d257","user":{"login":"SsnL","id":5674597,"avatar_url":"https://avatars2.githubusercontent.com/u/5674597?v=4","gravatar_id":"","url":"https://api.github.com/users/SsnL","html_url":"https://github.com/SsnL","followers_url":"https://api.github.com/users/SsnL/followers","following_url":"https://api.github.com/users/SsnL/following{/other_user}","gists_url":"https://api.github.com/users/SsnL/gists{/gist_id}","starred_url":"https://api.github.com/users/SsnL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SsnL/subscriptions","organizations_url":"https://api.github.com/users/SsnL/orgs","repos_url":"https://api.github.com/users/SsnL/repos","events_url":"https://api.github.com/users/SsnL/events{/privacy}","received_events_url":"https://api.github.com/users/SsnL/received_events","type":"User","site_admin":false},"repo":{"id":103305558,"name":"pytorch","full_name":"SsnL/pytorch","owner":{"login":"SsnL","id":5674597,"avatar_url":"https://avatars2.githubusercontent.com/u/5674597?v=4","gravatar_id":"","url":"https://api.github.com/users/SsnL","html_url":"https://github.com/SsnL","followers_url":"https://api.github.com/users/SsnL/followers","following_url":"https://api.github.com/users/SsnL/following{/other_user}","gists_url":"https://api.github.com/users/SsnL/gists{/gist_id}","starred_url":"https://api.github.com/users/SsnL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SsnL/subscriptions","organizations_url":"https://api.github.com/users/SsnL/orgs","repos_url":"https://api.github.com/users/SsnL/repos","events_url":"https://api.github.com/users/SsnL/events{/privacy}","received_events_url":"https://api.github.com/users/SsnL/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SsnL/pytorch","description":"Tensors and Dynamic neural networks in Python  with strong GPU acceleration","fork":true,"url":"https://api.github.com/repos/SsnL/pytorch","forks_url":"https://api.github.com/repos/SsnL/pytorch/forks","keys_url":"https://api.github.com/repos/SsnL/pytorch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SsnL/pytorch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SsnL/pytorch/teams","hooks_url":"https://api.github.com/repos/SsnL/pytorch/hooks","issue_events_url":"https://api.github.com/repos/SsnL/pytorch/issues/events{/number}","events_url":"https://api.github.com/repos/SsnL/pytorch/events","assignees_url":"https://api.github.com/repos/SsnL/pytorch/assignees{/user}","branches_url":"https://api.github.com/repos/SsnL/pytorch/branches{/branch}","tags_url":"https://api.github.com/repos/SsnL/pytorch/tags","blobs_url":"https://api.github.com/repos/SsnL/pytorch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SsnL/pytorch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SsnL/pytorch/git/refs{/sha}","trees_url":"https://api.github.com/repos/SsnL/pytorch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SsnL/pytorch/statuses/{sha}","languages_url":"https://api.github.com/repos/SsnL/pytorch/languages","stargazers_url":"https://api.github.com/repos/SsnL/pytorch/stargazers","contributors_url":"https://api.github.com/repos/SsnL/pytorch/contributors","subscribers_url":"https://api.github.com/repos/SsnL/pytorch/subscribers","subscription_url":"https://api.github.com/repos/SsnL/pytorch/subscription","commits_url":"https://api.github.com/repos/SsnL/pytorch/commits{/sha}","git_commits_url":"https://api.github.com/repos/SsnL/pytorch/git/commits{/sha}","comments_url":"https://api.github.com/repos/SsnL/pytorch/comments{/number}","issue_comment_url":"https://api.github.com/repos/SsnL/pytorch/issues/comments{/number}","contents_url":"https://api.github.com/repos/SsnL/pytorch/contents/{+path}","compare_url":"https://api.github.com/repos/SsnL/pytorch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SsnL/pytorch/merges","archive_url":"https://api.github.com/repos/SsnL/pytorch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SsnL/pytorch/downloads","issues_url":"https://api.github.com/repos/SsnL/pytorch/issues{/number}","pulls_url":"https://api.github.com/repos/SsnL/pytorch/pulls{/number}","milestones_url":"https://api.github.com/repos/SsnL/pytorch/milestones{/number}","notifications_url":"https://api.github.com/repos/SsnL/pytorch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SsnL/pytorch/labels{/name}","releases_url":"https://api.github.com/repos/SsnL/pytorch/releases{/id}","deployments_url":"https://api.github.com/repos/SsnL/pytorch/deployments","created_at":"2017-09-12T18:13:43Z","updated_at":"2017-09-12T18:13:49Z","pushed_at":"2017-10-19T14:41:39Z","git_url":"git://github.com/SsnL/pytorch.git","ssh_url":"git@github.com:SsnL/pytorch.git","clone_url":"https://github.com/SsnL/pytorch.git","svn_url":"https://github.com/SsnL/pytorch","homepage":"http://pytorch.org","size":16230,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytorch:master","ref":"master","sha":"7fd6fd6d8035afd2c9e0ec2cb30772dd0d6a85e3","user":{"login":"pytorch","id":21003710,"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,"name":"pytorch","full_name":"pytorch/pytorch","owner":{"login":"pytorch","id":21003710,"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},"private":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":"2017-10-19T14:38:52Z","pushed_at":"2017-10-19T15:15:46Z","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":16267,"stargazers_count":8266,"watchers_count":8266,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1719,"mirror_url":null,"open_issues_count":413,"forks":1719,"open_issues":413,"watchers":8266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/3178"},"html":{"href":"https://github.com/pytorch/pytorch/pull/3178"},"issue":{"href":"https://api.github.com/repos/pytorch/pytorch/issues/3178"},"comments":{"href":"https://api.github.com/repos/pytorch/pytorch/issues/3178/comments"},"review_comments":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/3178/comments"},"review_comment":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytorch/pytorch/pulls/3178/commits"},"statuses":{"href":"https://api.github.com/repos/pytorch/pytorch/statuses/e323933c5f24a6c53ed68f474c436f84fa37d257"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"SsnL"}}