{"action":"created","comment":{"url":"https://api.github.com/repos/pytorch/glow/pulls/comments/198341726","pull_request_review_id":132256512,"id":198341726,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODM0MTcyNg==","diff_hunk":"@@ -909,6 +985,45 @@ static NodeValue simplifyConcatNode(Function *F, ConcatNode *CN) {\n     }\n   }\n \n+  /// If the inputs of concat are all reshape nodes, and the inputs of reshape\n+  /// are able to be concatenated, then we can perform concat first and then\n+  /// reshape. Concat(Reshape(x) * N) -> Reshape(Concat(x * N)).\n+  {\n+    std::vector<ReshapeNode *> reshapes;\n+    bool optimizable = true;\n+    for (auto &I : CN->getInputs()) {\n+      if (auto *S = dyn_cast<ReshapeNode>(I)) {\n+        // The input of Reshape nodes should have the same shape.\n+        if (reshapes.size() == 0 ||\n+            reshapes.front()->getInput().dims().size() ==\n+                S->getInput().dims().size()) {\n+          reshapes.push_back(S);\n+          continue;\n+        }\n+      }\n+      optimizable = false;\n+      break;\n+    }\n+    // The inputs of Concat have to be all Reshape nodes, so that we can\n+    // perform the transformation.\n+    if (!optimizable) {\n+      return NodeValue(nullptr);\n+    }\n+    std::vector<NodeValue> newInputs;","path":"lib/Optimizer/GraphOptimizer.cpp","position":118,"original_position":118,"commit_id":"bed564a9563addef170c39ed1f3c7b599d9da77d","original_commit_id":"bed564a9563addef170c39ed1f3c7b599d9da77d","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":"thx for the review. But how do i set the vector size here? if i want to statically allocate.","created_at":"2018-06-27T01:16:20Z","updated_at":"2018-06-27T01:16:20Z","html_url":"https://github.com/pytorch/glow/pull/1171#discussion_r198341726","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/198341726"},"html":{"href":"https://github.com/pytorch/glow/pull/1171#discussion_r198341726"},"pull_request":{"href":"https://api.github.com/repos/pytorch/glow/pulls/1171"}},"in_reply_to_id":198329388},"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\n`Concat(Reshape(x) * N) -> Reshape(Concat(x * N))`.","created_at":"2018-06-25T07:28:14Z","updated_at":"2018-06-27T01:16:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40df1da5af43d10633a0011f6a47eb6c3b5a8309","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/bed564a9563addef170c39ed1f3c7b599d9da77d","head":{"label":"ZchiPitt:concatWithReshape","ref":"concatWithReshape","sha":"bed564a9563addef170c39ed1f3c7b599d9da77d","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-26T05:06:32Z","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":6440,"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":"1f2a43d52858f4fb11f33e9c617f6e94a2eccdea","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-26T23:09:33Z","pushed_at":"2018-06-26T23:27:40Z","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":6449,"stargazers_count":616,"watchers_count":616,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"archived":false,"open_issues_count":19,"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":62,"open_issues":19,"watchers":616,"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/bed564a9563addef170c39ed1f3c7b599d9da77d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ZchiPitt"}}