{"action":"created","comment":{"url":"https://api.github.com/repos/onnx/onnx/pulls/comments/187466268","pull_request_review_id":119255272,"id":187466268,"diff_hunk":"@@ -38,6 +38,47 @@ inline int64_t getAttribute(InferenceContext& ctx, const std::string& attributeN\n   return defaultValue;\n }\n \n+inline TensorShapeProto::Dimension operator*(TensorShapeProto::Dimension dim1, TensorShapeProto::Dimension dim2) {\n+  TensorShapeProto::Dimension result;\n+  if (dim1.has_dim_value() && dim2.has_dim_value()) {\n+    result.set_dim_value(dim1.dim_value() * dim2.dim_value());\n+  }\telse if (dim1.has_dim_value() && (dim1.dim_value() == 1)) {\n+    return dim2;\n+  }\telse if (dim2.has_dim_value() && (dim2.dim_value() == 1)) {\n+    return dim1;\n+  }\n+  return result;\n+}\n+\n+inline TensorShapeProto::Dimension operator*(TensorShapeProto::Dimension dim1, int64_t dim2) {\n+  TensorShapeProto::Dimension result;\n+  if (dim1.has_dim_value()) {\n+\t  result.set_dim_value(dim1.dim_value() * dim2);\n+  }\telse if (dim2 == 1) {\n+    return dim1;\n+  }\n+  return result;\n+}\n+\n+inline TensorShapeProto::Dimension operator/(TensorShapeProto::Dimension dim1, int64_t dim2) {","path":"onnx/defs/shape_inference.h","position":26,"original_position":26,"commit_id":"9d881379cc629753e01cadd7cb4b51908cf76bf3","original_commit_id":"9d881379cc629753e01cadd7cb4b51908cf76bf3","user":{"login":"anderspapitto","id":1388690,"avatar_url":"https://avatars3.githubusercontent.com/u/1388690?v=4","gravatar_id":"","url":"https://api.github.com/users/anderspapitto","html_url":"https://github.com/anderspapitto","followers_url":"https://api.github.com/users/anderspapitto/followers","following_url":"https://api.github.com/users/anderspapitto/following{/other_user}","gists_url":"https://api.github.com/users/anderspapitto/gists{/gist_id}","starred_url":"https://api.github.com/users/anderspapitto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anderspapitto/subscriptions","organizations_url":"https://api.github.com/users/anderspapitto/orgs","repos_url":"https://api.github.com/users/anderspapitto/repos","events_url":"https://api.github.com/users/anderspapitto/events{/privacy}","received_events_url":"https://api.github.com/users/anderspapitto/received_events","type":"User","site_admin":false},"body":"I feel that dividing dimensions is pretty rare, and what to do when they don't divide evenly is not necessarily so clear and universal that it should necessarily be wrapped up into an operator.","created_at":"2018-05-10T21:31:24Z","updated_at":"2018-05-10T21:31:24Z","html_url":"https://github.com/onnx/onnx/pull/930#discussion_r187466268","pull_request_url":"https://api.github.com/repos/onnx/onnx/pulls/930","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/onnx/onnx/pulls/comments/187466268"},"html":{"href":"https://github.com/onnx/onnx/pull/930#discussion_r187466268"},"pull_request":{"href":"https://api.github.com/repos/onnx/onnx/pulls/930"}}},"pull_request":{"url":"https://api.github.com/repos/onnx/onnx/pulls/930","id":187262514,"html_url":"https://github.com/onnx/onnx/pull/930","diff_url":"https://github.com/onnx/onnx/pull/930.diff","patch_url":"https://github.com/onnx/onnx/pull/930.patch","issue_url":"https://api.github.com/repos/onnx/onnx/issues/930","number":930,"state":"open","locked":false,"title":"Shape and type inference for Flatten, SpaceToDepth, DepthToSpace","user":{"login":"gramalingam","id":10075881,"avatar_url":"https://avatars0.githubusercontent.com/u/10075881?v=4","gravatar_id":"","url":"https://api.github.com/users/gramalingam","html_url":"https://github.com/gramalingam","followers_url":"https://api.github.com/users/gramalingam/followers","following_url":"https://api.github.com/users/gramalingam/following{/other_user}","gists_url":"https://api.github.com/users/gramalingam/gists{/gist_id}","starred_url":"https://api.github.com/users/gramalingam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gramalingam/subscriptions","organizations_url":"https://api.github.com/users/gramalingam/orgs","repos_url":"https://api.github.com/users/gramalingam/repos","events_url":"https://api.github.com/users/gramalingam/events{/privacy}","received_events_url":"https://api.github.com/users/gramalingam/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-10T17:59:28Z","updated_at":"2018-05-10T21:31:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a55a10665f87d3b368687f69b9a7247f5aea351","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/onnx/onnx/pulls/930/commits","review_comments_url":"https://api.github.com/repos/onnx/onnx/pulls/930/comments","review_comment_url":"https://api.github.com/repos/onnx/onnx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onnx/onnx/issues/930/comments","statuses_url":"https://api.github.com/repos/onnx/onnx/statuses/9d881379cc629753e01cadd7cb4b51908cf76bf3","head":{"label":"gramalingam:inference/fsd","ref":"inference/fsd","sha":"9d881379cc629753e01cadd7cb4b51908cf76bf3","user":{"login":"gramalingam","id":10075881,"avatar_url":"https://avatars0.githubusercontent.com/u/10075881?v=4","gravatar_id":"","url":"https://api.github.com/users/gramalingam","html_url":"https://github.com/gramalingam","followers_url":"https://api.github.com/users/gramalingam/followers","following_url":"https://api.github.com/users/gramalingam/following{/other_user}","gists_url":"https://api.github.com/users/gramalingam/gists{/gist_id}","starred_url":"https://api.github.com/users/gramalingam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gramalingam/subscriptions","organizations_url":"https://api.github.com/users/gramalingam/orgs","repos_url":"https://api.github.com/users/gramalingam/repos","events_url":"https://api.github.com/users/gramalingam/events{/privacy}","received_events_url":"https://api.github.com/users/gramalingam/received_events","type":"User","site_admin":false},"repo":{"id":131796753,"name":"onnx","full_name":"gramalingam/onnx","owner":{"login":"gramalingam","id":10075881,"avatar_url":"https://avatars0.githubusercontent.com/u/10075881?v=4","gravatar_id":"","url":"https://api.github.com/users/gramalingam","html_url":"https://github.com/gramalingam","followers_url":"https://api.github.com/users/gramalingam/followers","following_url":"https://api.github.com/users/gramalingam/following{/other_user}","gists_url":"https://api.github.com/users/gramalingam/gists{/gist_id}","starred_url":"https://api.github.com/users/gramalingam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gramalingam/subscriptions","organizations_url":"https://api.github.com/users/gramalingam/orgs","repos_url":"https://api.github.com/users/gramalingam/repos","events_url":"https://api.github.com/users/gramalingam/events{/privacy}","received_events_url":"https://api.github.com/users/gramalingam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gramalingam/onnx","description":"Open Neural Network Exchange","fork":true,"url":"https://api.github.com/repos/gramalingam/onnx","forks_url":"https://api.github.com/repos/gramalingam/onnx/forks","keys_url":"https://api.github.com/repos/gramalingam/onnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gramalingam/onnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gramalingam/onnx/teams","hooks_url":"https://api.github.com/repos/gramalingam/onnx/hooks","issue_events_url":"https://api.github.com/repos/gramalingam/onnx/issues/events{/number}","events_url":"https://api.github.com/repos/gramalingam/onnx/events","assignees_url":"https://api.github.com/repos/gramalingam/onnx/assignees{/user}","branches_url":"https://api.github.com/repos/gramalingam/onnx/branches{/branch}","tags_url":"https://api.github.com/repos/gramalingam/onnx/tags","blobs_url":"https://api.github.com/repos/gramalingam/onnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gramalingam/onnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gramalingam/onnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/gramalingam/onnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gramalingam/onnx/statuses/{sha}","languages_url":"https://api.github.com/repos/gramalingam/onnx/languages","stargazers_url":"https://api.github.com/repos/gramalingam/onnx/stargazers","contributors_url":"https://api.github.com/repos/gramalingam/onnx/contributors","subscribers_url":"https://api.github.com/repos/gramalingam/onnx/subscribers","subscription_url":"https://api.github.com/repos/gramalingam/onnx/subscription","commits_url":"https://api.github.com/repos/gramalingam/onnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/gramalingam/onnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/gramalingam/onnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/gramalingam/onnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/gramalingam/onnx/contents/{+path}","compare_url":"https://api.github.com/repos/gramalingam/onnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gramalingam/onnx/merges","archive_url":"https://api.github.com/repos/gramalingam/onnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gramalingam/onnx/downloads","issues_url":"https://api.github.com/repos/gramalingam/onnx/issues{/number}","pulls_url":"https://api.github.com/repos/gramalingam/onnx/pulls{/number}","milestones_url":"https://api.github.com/repos/gramalingam/onnx/milestones{/number}","notifications_url":"https://api.github.com/repos/gramalingam/onnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gramalingam/onnx/labels{/name}","releases_url":"https://api.github.com/repos/gramalingam/onnx/releases{/id}","deployments_url":"https://api.github.com/repos/gramalingam/onnx/deployments","created_at":"2018-05-02T04:09:20Z","updated_at":"2018-05-10T04:47:44Z","pushed_at":"2018-05-10T18:18:48Z","git_url":"git://github.com/gramalingam/onnx.git","ssh_url":"git@github.com:gramalingam/onnx.git","clone_url":"https://github.com/gramalingam/onnx.git","svn_url":"https://github.com/gramalingam/onnx","homepage":"https://onnx.ai/","size":4524,"stargazers_count":0,"watchers_count":0,"language":"PureBasic","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":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"onnx:master","ref":"master","sha":"008a8054fdddf7ed0209d27f3f3c1aea87f44b8a","user":{"login":"onnx","id":31675368,"avatar_url":"https://avatars3.githubusercontent.com/u/31675368?v=4","gravatar_id":"","url":"https://api.github.com/users/onnx","html_url":"https://github.com/onnx","followers_url":"https://api.github.com/users/onnx/followers","following_url":"https://api.github.com/users/onnx/following{/other_user}","gists_url":"https://api.github.com/users/onnx/gists{/gist_id}","starred_url":"https://api.github.com/users/onnx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onnx/subscriptions","organizations_url":"https://api.github.com/users/onnx/orgs","repos_url":"https://api.github.com/users/onnx/repos","events_url":"https://api.github.com/users/onnx/events{/privacy}","received_events_url":"https://api.github.com/users/onnx/received_events","type":"Organization","site_admin":false},"repo":{"id":102692863,"name":"onnx","full_name":"onnx/onnx","owner":{"login":"onnx","id":31675368,"avatar_url":"https://avatars3.githubusercontent.com/u/31675368?v=4","gravatar_id":"","url":"https://api.github.com/users/onnx","html_url":"https://github.com/onnx","followers_url":"https://api.github.com/users/onnx/followers","following_url":"https://api.github.com/users/onnx/following{/other_user}","gists_url":"https://api.github.com/users/onnx/gists{/gist_id}","starred_url":"https://api.github.com/users/onnx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onnx/subscriptions","organizations_url":"https://api.github.com/users/onnx/orgs","repos_url":"https://api.github.com/users/onnx/repos","events_url":"https://api.github.com/users/onnx/events{/privacy}","received_events_url":"https://api.github.com/users/onnx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/onnx/onnx","description":"Open Neural Network Exchange","fork":false,"url":"https://api.github.com/repos/onnx/onnx","forks_url":"https://api.github.com/repos/onnx/onnx/forks","keys_url":"https://api.github.com/repos/onnx/onnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onnx/onnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onnx/onnx/teams","hooks_url":"https://api.github.com/repos/onnx/onnx/hooks","issue_events_url":"https://api.github.com/repos/onnx/onnx/issues/events{/number}","events_url":"https://api.github.com/repos/onnx/onnx/events","assignees_url":"https://api.github.com/repos/onnx/onnx/assignees{/user}","branches_url":"https://api.github.com/repos/onnx/onnx/branches{/branch}","tags_url":"https://api.github.com/repos/onnx/onnx/tags","blobs_url":"https://api.github.com/repos/onnx/onnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onnx/onnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onnx/onnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/onnx/onnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onnx/onnx/statuses/{sha}","languages_url":"https://api.github.com/repos/onnx/onnx/languages","stargazers_url":"https://api.github.com/repos/onnx/onnx/stargazers","contributors_url":"https://api.github.com/repos/onnx/onnx/contributors","subscribers_url":"https://api.github.com/repos/onnx/onnx/subscribers","subscription_url":"https://api.github.com/repos/onnx/onnx/subscription","commits_url":"https://api.github.com/repos/onnx/onnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/onnx/onnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/onnx/onnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/onnx/onnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/onnx/onnx/contents/{+path}","compare_url":"https://api.github.com/repos/onnx/onnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onnx/onnx/merges","archive_url":"https://api.github.com/repos/onnx/onnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onnx/onnx/downloads","issues_url":"https://api.github.com/repos/onnx/onnx/issues{/number}","pulls_url":"https://api.github.com/repos/onnx/onnx/pulls{/number}","milestones_url":"https://api.github.com/repos/onnx/onnx/milestones{/number}","notifications_url":"https://api.github.com/repos/onnx/onnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onnx/onnx/labels{/name}","releases_url":"https://api.github.com/repos/onnx/onnx/releases{/id}","deployments_url":"https://api.github.com/repos/onnx/onnx/deployments","created_at":"2017-09-07T04:53:45Z","updated_at":"2018-05-10T21:27:52Z","pushed_at":"2018-05-10T19:08:48Z","git_url":"git://github.com/onnx/onnx.git","ssh_url":"git@github.com:onnx/onnx.git","clone_url":"https://github.com/onnx/onnx.git","svn_url":"https://github.com/onnx/onnx","homepage":"https://onnx.ai/","size":4491,"stargazers_count":3377,"watchers_count":3377,"language":"PureBasic","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":417,"mirror_url":null,"archived":false,"open_issues_count":177,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":417,"open_issues":177,"watchers":3377,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onnx/onnx/pulls/930"},"html":{"href":"https://github.com/onnx/onnx/pull/930"},"issue":{"href":"https://api.github.com/repos/onnx/onnx/issues/930"},"comments":{"href":"https://api.github.com/repos/onnx/onnx/issues/930/comments"},"review_comments":{"href":"https://api.github.com/repos/onnx/onnx/pulls/930/comments"},"review_comment":{"href":"https://api.github.com/repos/onnx/onnx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onnx/onnx/pulls/930/commits"},"statuses":{"href":"https://api.github.com/repos/onnx/onnx/statuses/9d881379cc629753e01cadd7cb4b51908cf76bf3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"anderspapitto"}}