{"action":"created","comment":{"url":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/comments/244928600","pull_request_review_id":188920823,"id":244928600,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDkyODYwMA==","diff_hunk":"@@ -89,13 +89,10 @@ def make_range_non_const(ctx, start, limit, delta, output, name, dtype):\n \n     return nodes\n \n-def make_range(ctx, start, limit, delta, output, name, dtype):\n-    start_node = ctx.get_node_by_output(start)\n-    limit_node = ctx.get_node_by_output(limit)\n-    delta_node = ctx.get_node_by_output(delta)\n-    if start_node.is_const() and limit_node.is_const() and delta_node.is_const():\n-        return make_range_const(ctx, start_node, limit_node, delta_node, output, name, dtype)\n-    return make_range_non_const(ctx, start, limit, delta, output, name, dtype)\n+def make_range(ctx, start, limit, delta, output, scope_name, dtype):\n+    if all([ctx.get_node_by_output(n).is_const() for n in [start, limit, delta]]):\n+        return make_range_const(ctx, start, limit, delta, output, scope_name, dtype)","path":"tf2onnx/function/range.py","position":94,"original_position":44,"commit_id":"ad062f81a92a70459bd479aa4beb87f930440b70","original_commit_id":"ad062f81a92a70459bd479aa4beb87f930440b70","user":{"login":"nbcsm","id":32868157,"node_id":"MDQ6VXNlcjMyODY4MTU3","avatar_url":"https://avatars1.githubusercontent.com/u/32868157?v=4","gravatar_id":"","url":"https://api.github.com/users/nbcsm","html_url":"https://github.com/nbcsm","followers_url":"https://api.github.com/users/nbcsm/followers","following_url":"https://api.github.com/users/nbcsm/following{/other_user}","gists_url":"https://api.github.com/users/nbcsm/gists{/gist_id}","starred_url":"https://api.github.com/users/nbcsm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbcsm/subscriptions","organizations_url":"https://api.github.com/users/nbcsm/orgs","repos_url":"https://api.github.com/users/nbcsm/repos","events_url":"https://api.github.com/users/nbcsm/events{/privacy}","received_events_url":"https://api.github.com/users/nbcsm/received_events","type":"User","site_admin":false},"body":"all([ctx.get_node_by_output(n).is_const() for n in [start, limit, delta]])\r\n=>\r\nall(ctx.get_node_by_output(n).is_const() for n in [start, limit, delta])\r\n\r\nno need to create a list again.","created_at":"2019-01-03T08:02:16Z","updated_at":"2019-01-03T08:03:35Z","html_url":"https://github.com/onnx/tensorflow-onnx/pull/259#discussion_r244928600","pull_request_url":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/259","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/comments/244928600"},"html":{"href":"https://github.com/onnx/tensorflow-onnx/pull/259#discussion_r244928600"},"pull_request":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/259"}}},"pull_request":{"url":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/259","id":241308489,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMzA4NDg5","html_url":"https://github.com/onnx/tensorflow-onnx/pull/259","diff_url":"https://github.com/onnx/tensorflow-onnx/pull/259.diff","patch_url":"https://github.com/onnx/tensorflow-onnx/pull/259.patch","issue_url":"https://api.github.com/repos/onnx/tensorflow-onnx/issues/259","number":259,"state":"open","locked":false,"title":"Support sparse_softmax_cross_entropy_with_logits op with large class","user":{"login":"lucienwang1009","id":28888626,"node_id":"MDQ6VXNlcjI4ODg4NjI2","avatar_url":"https://avatars2.githubusercontent.com/u/28888626?v=4","gravatar_id":"","url":"https://api.github.com/users/lucienwang1009","html_url":"https://github.com/lucienwang1009","followers_url":"https://api.github.com/users/lucienwang1009/followers","following_url":"https://api.github.com/users/lucienwang1009/following{/other_user}","gists_url":"https://api.github.com/users/lucienwang1009/gists{/gist_id}","starred_url":"https://api.github.com/users/lucienwang1009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucienwang1009/subscriptions","organizations_url":"https://api.github.com/users/lucienwang1009/orgs","repos_url":"https://api.github.com/users/lucienwang1009/repos","events_url":"https://api.github.com/users/lucienwang1009/events{/privacy}","received_events_url":"https://api.github.com/users/lucienwang1009/received_events","type":"User","site_admin":false},"body":"- When the number of label category is too large, the current converter will generate a huge eye matrix which cannot be stored in protobuf. This PR uses `GatherNd` to circumvent the problem.\r\n- Put some complex conversion code (`Range`, `SparseSoftmax...`) into `function/` dir.  \r\n- Wrap `Range` and `GatherNd` conversion functions.","created_at":"2018-12-28T10:33:55Z","updated_at":"2019-01-03T08:03:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6141e2517466130db521204aa7b064565d7d7398","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pengwa","id":10530022,"node_id":"MDQ6VXNlcjEwNTMwMDIy","avatar_url":"https://avatars1.githubusercontent.com/u/10530022?v=4","gravatar_id":"","url":"https://api.github.com/users/pengwa","html_url":"https://github.com/pengwa","followers_url":"https://api.github.com/users/pengwa/followers","following_url":"https://api.github.com/users/pengwa/following{/other_user}","gists_url":"https://api.github.com/users/pengwa/gists{/gist_id}","starred_url":"https://api.github.com/users/pengwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pengwa/subscriptions","organizations_url":"https://api.github.com/users/pengwa/orgs","repos_url":"https://api.github.com/users/pengwa/repos","events_url":"https://api.github.com/users/pengwa/events{/privacy}","received_events_url":"https://api.github.com/users/pengwa/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/259/commits","review_comments_url":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/259/comments","review_comment_url":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onnx/tensorflow-onnx/issues/259/comments","statuses_url":"https://api.github.com/repos/onnx/tensorflow-onnx/statuses/ad062f81a92a70459bd479aa4beb87f930440b70","head":{"label":"lucienwang1009:sparse_softmax","ref":"sparse_softmax","sha":"ad062f81a92a70459bd479aa4beb87f930440b70","user":{"login":"lucienwang1009","id":28888626,"node_id":"MDQ6VXNlcjI4ODg4NjI2","avatar_url":"https://avatars2.githubusercontent.com/u/28888626?v=4","gravatar_id":"","url":"https://api.github.com/users/lucienwang1009","html_url":"https://github.com/lucienwang1009","followers_url":"https://api.github.com/users/lucienwang1009/followers","following_url":"https://api.github.com/users/lucienwang1009/following{/other_user}","gists_url":"https://api.github.com/users/lucienwang1009/gists{/gist_id}","starred_url":"https://api.github.com/users/lucienwang1009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucienwang1009/subscriptions","organizations_url":"https://api.github.com/users/lucienwang1009/orgs","repos_url":"https://api.github.com/users/lucienwang1009/repos","events_url":"https://api.github.com/users/lucienwang1009/events{/privacy}","received_events_url":"https://api.github.com/users/lucienwang1009/received_events","type":"User","site_admin":false},"repo":{"id":149420835,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk0MjA4MzU=","name":"tensorflow-onnx","full_name":"lucienwang1009/tensorflow-onnx","private":false,"owner":{"login":"lucienwang1009","id":28888626,"node_id":"MDQ6VXNlcjI4ODg4NjI2","avatar_url":"https://avatars2.githubusercontent.com/u/28888626?v=4","gravatar_id":"","url":"https://api.github.com/users/lucienwang1009","html_url":"https://github.com/lucienwang1009","followers_url":"https://api.github.com/users/lucienwang1009/followers","following_url":"https://api.github.com/users/lucienwang1009/following{/other_user}","gists_url":"https://api.github.com/users/lucienwang1009/gists{/gist_id}","starred_url":"https://api.github.com/users/lucienwang1009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucienwang1009/subscriptions","organizations_url":"https://api.github.com/users/lucienwang1009/orgs","repos_url":"https://api.github.com/users/lucienwang1009/repos","events_url":"https://api.github.com/users/lucienwang1009/events{/privacy}","received_events_url":"https://api.github.com/users/lucienwang1009/received_events","type":"User","site_admin":false},"html_url":"https://github.com/lucienwang1009/tensorflow-onnx","description":"Convert TensorFlow models to ONNX","fork":true,"url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx","forks_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/forks","keys_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/teams","hooks_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/hooks","issue_events_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/issues/events{/number}","events_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/events","assignees_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/assignees{/user}","branches_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/branches{/branch}","tags_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/tags","blobs_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/statuses/{sha}","languages_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/languages","stargazers_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/stargazers","contributors_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/contributors","subscribers_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/subscribers","subscription_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/subscription","commits_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/contents/{+path}","compare_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/merges","archive_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/downloads","issues_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/issues{/number}","pulls_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/pulls{/number}","milestones_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/milestones{/number}","notifications_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/labels{/name}","releases_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/releases{/id}","deployments_url":"https://api.github.com/repos/lucienwang1009/tensorflow-onnx/deployments","created_at":"2018-09-19T08:51:31Z","updated_at":"2018-12-28T07:44:02Z","pushed_at":"2019-01-02T09:56:34Z","git_url":"git://github.com/lucienwang1009/tensorflow-onnx.git","ssh_url":"git@github.com:lucienwang1009/tensorflow-onnx.git","clone_url":"https://github.com/lucienwang1009/tensorflow-onnx.git","svn_url":"https://github.com/lucienwang1009/tensorflow-onnx","homepage":null,"size":15495,"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,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"onnx:master","ref":"master","sha":"7858b28594be375ec46e470eaf2411a9a97dd2ff","user":{"login":"onnx","id":31675368,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNjc1MzY4","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":125098252,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUwOTgyNTI=","name":"tensorflow-onnx","full_name":"onnx/tensorflow-onnx","private":false,"owner":{"login":"onnx","id":31675368,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNjc1MzY4","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},"html_url":"https://github.com/onnx/tensorflow-onnx","description":"Convert TensorFlow models to ONNX","fork":false,"url":"https://api.github.com/repos/onnx/tensorflow-onnx","forks_url":"https://api.github.com/repos/onnx/tensorflow-onnx/forks","keys_url":"https://api.github.com/repos/onnx/tensorflow-onnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onnx/tensorflow-onnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onnx/tensorflow-onnx/teams","hooks_url":"https://api.github.com/repos/onnx/tensorflow-onnx/hooks","issue_events_url":"https://api.github.com/repos/onnx/tensorflow-onnx/issues/events{/number}","events_url":"https://api.github.com/repos/onnx/tensorflow-onnx/events","assignees_url":"https://api.github.com/repos/onnx/tensorflow-onnx/assignees{/user}","branches_url":"https://api.github.com/repos/onnx/tensorflow-onnx/branches{/branch}","tags_url":"https://api.github.com/repos/onnx/tensorflow-onnx/tags","blobs_url":"https://api.github.com/repos/onnx/tensorflow-onnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onnx/tensorflow-onnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onnx/tensorflow-onnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/onnx/tensorflow-onnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onnx/tensorflow-onnx/statuses/{sha}","languages_url":"https://api.github.com/repos/onnx/tensorflow-onnx/languages","stargazers_url":"https://api.github.com/repos/onnx/tensorflow-onnx/stargazers","contributors_url":"https://api.github.com/repos/onnx/tensorflow-onnx/contributors","subscribers_url":"https://api.github.com/repos/onnx/tensorflow-onnx/subscribers","subscription_url":"https://api.github.com/repos/onnx/tensorflow-onnx/subscription","commits_url":"https://api.github.com/repos/onnx/tensorflow-onnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/onnx/tensorflow-onnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/onnx/tensorflow-onnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/onnx/tensorflow-onnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/onnx/tensorflow-onnx/contents/{+path}","compare_url":"https://api.github.com/repos/onnx/tensorflow-onnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onnx/tensorflow-onnx/merges","archive_url":"https://api.github.com/repos/onnx/tensorflow-onnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onnx/tensorflow-onnx/downloads","issues_url":"https://api.github.com/repos/onnx/tensorflow-onnx/issues{/number}","pulls_url":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls{/number}","milestones_url":"https://api.github.com/repos/onnx/tensorflow-onnx/milestones{/number}","notifications_url":"https://api.github.com/repos/onnx/tensorflow-onnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onnx/tensorflow-onnx/labels{/name}","releases_url":"https://api.github.com/repos/onnx/tensorflow-onnx/releases{/id}","deployments_url":"https://api.github.com/repos/onnx/tensorflow-onnx/deployments","created_at":"2018-03-13T18:39:56Z","updated_at":"2019-01-03T01:33:11Z","pushed_at":"2019-01-03T02:38:59Z","git_url":"git://github.com/onnx/tensorflow-onnx.git","ssh_url":"git@github.com:onnx/tensorflow-onnx.git","clone_url":"https://github.com/onnx/tensorflow-onnx.git","svn_url":"https://github.com/onnx/tensorflow-onnx","homepage":null,"size":15418,"stargazers_count":111,"watchers_count":111,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":41,"mirror_url":null,"archived":false,"open_issues_count":26,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":41,"open_issues":26,"watchers":111,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/259"},"html":{"href":"https://github.com/onnx/tensorflow-onnx/pull/259"},"issue":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/issues/259"},"comments":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/issues/259/comments"},"review_comments":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/259/comments"},"review_comment":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/pulls/259/commits"},"statuses":{"href":"https://api.github.com/repos/onnx/tensorflow-onnx/statuses/ad062f81a92a70459bd479aa4beb87f930440b70"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nbcsm"}}