{"action":"created","comment":{"url":"https://api.github.com/repos/pytorch/glow/pulls/comments/197963862","pull_request_review_id":131809415,"id":197963862,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Nzk2Mzg2Mg==","diff_hunk":"@@ -872,3 +872,49 @@ TEST_F(GraphOptz, concatElim) {\n   // Check that the concat node is gone.\n   EXPECT_EQ(countNodeKind(F_, Kinded::Kind::ConcatNodeKind), 0);\n }\n+\n+// Check the transformation Concat(Reshape(x) * N) -> Reshape(Concat(x * N)).\n+TEST_F(GraphOptz, concatReshapes) {\n+  const size_t shape[] = {10, 20};\n+  const size_t reshape[] = {10, 1, 20};\n+  Type t(ElemKind::FloatTy, shape);\n+  std::vector<NodeValue> inputs;\n+  for (size_t i = 0; i < 50; i++) {\n+    // Create 50 reshape nodes whose input is variable of shape {10,20}.\n+    // The reshape nodes will transform their input from shape of {10,20}\n+    // to {10, 1, 20}.\n+    Node *var = F_->getParent()->createVariable(ElemKind::FloatTy, shape,\n+                                                \"input\" + std::to_string(i));\n+    auto *RN = F_->createReshape(\"reshape\" + std::to_string(i), var, reshape);\n+    inputs.push_back(RN);\n+  }\n+  // Create a Concat node that concatenates the 50 reshape nodes.\n+  auto *CN = F_->createConcat(\"concat\", inputs, 1);\n+  auto outputShape = CN->getResult().dims();\n+  inputs.erase(inputs.begin(), inputs.end());","path":"tests/unittests/graphOptzTest.cpp","position":23,"original_position":23,"commit_id":"3da0fe56ef37a2f224c38fb7d14d1a5aa421e4c7","original_commit_id":"3da0fe56ef37a2f224c38fb7d14d1a5aa421e4c7","user":{"login":"rdzhabarov","id":34466929,"node_id":"MDQ6VXNlcjM0NDY2OTI5","avatar_url":"https://avatars0.githubusercontent.com/u/34466929?v=4","gravatar_id":"","url":"https://api.github.com/users/rdzhabarov","html_url":"https://github.com/rdzhabarov","followers_url":"https://api.github.com/users/rdzhabarov/followers","following_url":"https://api.github.com/users/rdzhabarov/following{/other_user}","gists_url":"https://api.github.com/users/rdzhabarov/gists{/gist_id}","starred_url":"https://api.github.com/users/rdzhabarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdzhabarov/subscriptions","organizations_url":"https://api.github.com/users/rdzhabarov/orgs","repos_url":"https://api.github.com/users/rdzhabarov/repos","events_url":"https://api.github.com/users/rdzhabarov/events{/privacy}","received_events_url":"https://api.github.com/users/rdzhabarov/received_events","type":"User","site_admin":false},"body":"why this?","created_at":"2018-06-25T22:37:55Z","updated_at":"2018-06-25T22:37:55Z","html_url":"https://github.com/pytorch/glow/pull/1171#discussion_r197963862","pull_request_url":"https://api.github.com/repos/pytorch/glow/pulls/1171","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pytorch/glow/pulls/comments/197963862"},"html":{"href":"https://github.com/pytorch/glow/pull/1171#discussion_r197963862"},"pull_request":{"href":"https://api.github.com/repos/pytorch/glow/pulls/1171"}}},"pull_request":{"url":"https://api.github.com/repos/pytorch/glow/pulls/1171","id":197023760,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3MDIzNzYw","html_url":"https://github.com/pytorch/glow/pull/1171","diff_url":"https://github.com/pytorch/glow/pull/1171.diff","patch_url":"https://github.com/pytorch/glow/pull/1171.patch","issue_url":"https://api.github.com/repos/pytorch/glow/issues/1171","number":1171,"state":"open","locked":false,"title":"[graph-optimizer]  Optimization on ConcatNode","user":{"login":"ZchiPitt","id":8838608,"node_id":"MDQ6VXNlcjg4Mzg2MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/8838608?v=4","gravatar_id":"","url":"https://api.github.com/users/ZchiPitt","html_url":"https://github.com/ZchiPitt","followers_url":"https://api.github.com/users/ZchiPitt/followers","following_url":"https://api.github.com/users/ZchiPitt/following{/other_user}","gists_url":"https://api.github.com/users/ZchiPitt/gists{/gist_id}","starred_url":"https://api.github.com/users/ZchiPitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZchiPitt/subscriptions","organizations_url":"https://api.github.com/users/ZchiPitt/orgs","repos_url":"https://api.github.com/users/ZchiPitt/repos","events_url":"https://api.github.com/users/ZchiPitt/events{/privacy}","received_events_url":"https://api.github.com/users/ZchiPitt/received_events","type":"User","site_admin":false},"body":"If the inputs of concat are all reshape nodes, and the inputs of reshape are able to be concatenated, then we can perform concat first and then reshape.\r\n\r\nConcat(Reshape(x) * N) -> Reshape(Concat(x * N)).","created_at":"2018-06-25T07:28:14Z","updated_at":"2018-06-25T22:37:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a19232bd5c0fc1eaed07d0f7e8fa044cc71a2041","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":706497924,"node_id":"MDU6TGFiZWw3MDY0OTc5MjQ=","url":"https://api.github.com/repos/pytorch/glow/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pytorch/glow/pulls/1171/commits","review_comments_url":"https://api.github.com/repos/pytorch/glow/pulls/1171/comments","review_comment_url":"https://api.github.com/repos/pytorch/glow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pytorch/glow/issues/1171/comments","statuses_url":"https://api.github.com/repos/pytorch/glow/statuses/3da0fe56ef37a2f224c38fb7d14d1a5aa421e4c7","head":{"label":"ZchiPitt:concatWithReshape","ref":"concatWithReshape","sha":"3da0fe56ef37a2f224c38fb7d14d1a5aa421e4c7","user":{"login":"ZchiPitt","id":8838608,"node_id":"MDQ6VXNlcjg4Mzg2MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/8838608?v=4","gravatar_id":"","url":"https://api.github.com/users/ZchiPitt","html_url":"https://github.com/ZchiPitt","followers_url":"https://api.github.com/users/ZchiPitt/followers","following_url":"https://api.github.com/users/ZchiPitt/following{/other_user}","gists_url":"https://api.github.com/users/ZchiPitt/gists{/gist_id}","starred_url":"https://api.github.com/users/ZchiPitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZchiPitt/subscriptions","organizations_url":"https://api.github.com/users/ZchiPitt/orgs","repos_url":"https://api.github.com/users/ZchiPitt/repos","events_url":"https://api.github.com/users/ZchiPitt/events{/privacy}","received_events_url":"https://api.github.com/users/ZchiPitt/received_events","type":"User","site_admin":false},"repo":{"id":136248562,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYyNDg1NjI=","name":"glow","full_name":"ZchiPitt/glow","owner":{"login":"ZchiPitt","id":8838608,"node_id":"MDQ6VXNlcjg4Mzg2MDg=","avatar_url":"https://avatars1.githubusercontent.com/u/8838608?v=4","gravatar_id":"","url":"https://api.github.com/users/ZchiPitt","html_url":"https://github.com/ZchiPitt","followers_url":"https://api.github.com/users/ZchiPitt/followers","following_url":"https://api.github.com/users/ZchiPitt/following{/other_user}","gists_url":"https://api.github.com/users/ZchiPitt/gists{/gist_id}","starred_url":"https://api.github.com/users/ZchiPitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZchiPitt/subscriptions","organizations_url":"https://api.github.com/users/ZchiPitt/orgs","repos_url":"https://api.github.com/users/ZchiPitt/repos","events_url":"https://api.github.com/users/ZchiPitt/events{/privacy}","received_events_url":"https://api.github.com/users/ZchiPitt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ZchiPitt/glow","description":"Compiler for Neural Network hardware accelerators","fork":true,"url":"https://api.github.com/repos/ZchiPitt/glow","forks_url":"https://api.github.com/repos/ZchiPitt/glow/forks","keys_url":"https://api.github.com/repos/ZchiPitt/glow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZchiPitt/glow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZchiPitt/glow/teams","hooks_url":"https://api.github.com/repos/ZchiPitt/glow/hooks","issue_events_url":"https://api.github.com/repos/ZchiPitt/glow/issues/events{/number}","events_url":"https://api.github.com/repos/ZchiPitt/glow/events","assignees_url":"https://api.github.com/repos/ZchiPitt/glow/assignees{/user}","branches_url":"https://api.github.com/repos/ZchiPitt/glow/branches{/branch}","tags_url":"https://api.github.com/repos/ZchiPitt/glow/tags","blobs_url":"https://api.github.com/repos/ZchiPitt/glow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZchiPitt/glow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZchiPitt/glow/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZchiPitt/glow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZchiPitt/glow/statuses/{sha}","languages_url":"https://api.github.com/repos/ZchiPitt/glow/languages","stargazers_url":"https://api.github.com/repos/ZchiPitt/glow/stargazers","contributors_url":"https://api.github.com/repos/ZchiPitt/glow/contributors","subscribers_url":"https://api.github.com/repos/ZchiPitt/glow/subscribers","subscription_url":"https://api.github.com/repos/ZchiPitt/glow/subscription","commits_url":"https://api.github.com/repos/ZchiPitt/glow/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZchiPitt/glow/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZchiPitt/glow/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZchiPitt/glow/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZchiPitt/glow/contents/{+path}","compare_url":"https://api.github.com/repos/ZchiPitt/glow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZchiPitt/glow/merges","archive_url":"https://api.github.com/repos/ZchiPitt/glow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZchiPitt/glow/downloads","issues_url":"https://api.github.com/repos/ZchiPitt/glow/issues{/number}","pulls_url":"https://api.github.com/repos/ZchiPitt/glow/pulls{/number}","milestones_url":"https://api.github.com/repos/ZchiPitt/glow/milestones{/number}","notifications_url":"https://api.github.com/repos/ZchiPitt/glow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZchiPitt/glow/labels{/name}","releases_url":"https://api.github.com/repos/ZchiPitt/glow/releases{/id}","deployments_url":"https://api.github.com/repos/ZchiPitt/glow/deployments","created_at":"2018-06-06T00:07:35Z","updated_at":"2018-06-19T21:08:06Z","pushed_at":"2018-06-25T07:26:15Z","git_url":"git://github.com/ZchiPitt/glow.git","ssh_url":"git@github.com:ZchiPitt/glow.git","clone_url":"https://github.com/ZchiPitt/glow.git","svn_url":"https://github.com/ZchiPitt/glow","homepage":null,"size":6439,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pytorch:master","ref":"master","sha":"a83f749e4dd157534e87eb041a41e3eabbbcf09d","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":105281531,"node_id":"MDEwOlJlcG9zaXRvcnkxMDUyODE1MzE=","name":"glow","full_name":"pytorch/glow","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},"private":false,"html_url":"https://github.com/pytorch/glow","description":"Compiler for Neural Network hardware accelerators","fork":false,"url":"https://api.github.com/repos/pytorch/glow","forks_url":"https://api.github.com/repos/pytorch/glow/forks","keys_url":"https://api.github.com/repos/pytorch/glow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pytorch/glow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pytorch/glow/teams","hooks_url":"https://api.github.com/repos/pytorch/glow/hooks","issue_events_url":"https://api.github.com/repos/pytorch/glow/issues/events{/number}","events_url":"https://api.github.com/repos/pytorch/glow/events","assignees_url":"https://api.github.com/repos/pytorch/glow/assignees{/user}","branches_url":"https://api.github.com/repos/pytorch/glow/branches{/branch}","tags_url":"https://api.github.com/repos/pytorch/glow/tags","blobs_url":"https://api.github.com/repos/pytorch/glow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pytorch/glow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pytorch/glow/git/refs{/sha}","trees_url":"https://api.github.com/repos/pytorch/glow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pytorch/glow/statuses/{sha}","languages_url":"https://api.github.com/repos/pytorch/glow/languages","stargazers_url":"https://api.github.com/repos/pytorch/glow/stargazers","contributors_url":"https://api.github.com/repos/pytorch/glow/contributors","subscribers_url":"https://api.github.com/repos/pytorch/glow/subscribers","subscription_url":"https://api.github.com/repos/pytorch/glow/subscription","commits_url":"https://api.github.com/repos/pytorch/glow/commits{/sha}","git_commits_url":"https://api.github.com/repos/pytorch/glow/git/commits{/sha}","comments_url":"https://api.github.com/repos/pytorch/glow/comments{/number}","issue_comment_url":"https://api.github.com/repos/pytorch/glow/issues/comments{/number}","contents_url":"https://api.github.com/repos/pytorch/glow/contents/{+path}","compare_url":"https://api.github.com/repos/pytorch/glow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pytorch/glow/merges","archive_url":"https://api.github.com/repos/pytorch/glow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pytorch/glow/downloads","issues_url":"https://api.github.com/repos/pytorch/glow/issues{/number}","pulls_url":"https://api.github.com/repos/pytorch/glow/pulls{/number}","milestones_url":"https://api.github.com/repos/pytorch/glow/milestones{/number}","notifications_url":"https://api.github.com/repos/pytorch/glow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pytorch/glow/labels{/name}","releases_url":"https://api.github.com/repos/pytorch/glow/releases{/id}","deployments_url":"https://api.github.com/repos/pytorch/glow/deployments","created_at":"2017-09-29T14:28:18Z","updated_at":"2018-06-25T21:34:06Z","pushed_at":"2018-06-25T21:34:03Z","git_url":"git://github.com/pytorch/glow.git","ssh_url":"git@github.com:pytorch/glow.git","clone_url":"https://github.com/pytorch/glow.git","svn_url":"https://github.com/pytorch/glow","homepage":null,"size":6429,"stargazers_count":613,"watchers_count":613,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":61,"open_issues":17,"watchers":613,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pytorch/glow/pulls/1171"},"html":{"href":"https://github.com/pytorch/glow/pull/1171"},"issue":{"href":"https://api.github.com/repos/pytorch/glow/issues/1171"},"comments":{"href":"https://api.github.com/repos/pytorch/glow/issues/1171/comments"},"review_comments":{"href":"https://api.github.com/repos/pytorch/glow/pulls/1171/comments"},"review_comment":{"href":"https://api.github.com/repos/pytorch/glow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pytorch/glow/pulls/1171/commits"},"statuses":{"href":"https://api.github.com/repos/pytorch/glow/statuses/3da0fe56ef37a2f224c38fb7d14d1a5aa421e4c7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rdzhabarov"}}