{"action":"created","comment":{"url":"https://api.github.com/repos/onnx/onnx/pulls/comments/203824453","pull_request_review_id":138793280,"id":203824453,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzgyNDQ1Mw==","diff_hunk":"@@ -0,0 +1,77 @@\n+from __future__ import absolute_import\n+from __future__ import division\n+from __future__ import print_function\n+from __future__ import unicode_literals\n+\n+from onnx import checker, helper, ModelProto, TensorProto, GraphProto, NodeProto, OperatorSetIdProto\n+from typing import Sequence, Text, Tuple, List, Callable\n+from onnx import numpy_helper\n+\n+import numpy as np  # type: ignore\n+\n+import onnx.version_converter\n+import unittest\n+\n+\n+class TestVersionConverter(unittest.TestCase):\n+\n+    def _converted(\n+            self,\n+            graph,  # type: GraphProto\n+            initial_version,  # type: OperatorSetIdProto\n+            target_version  # type: int\n+    ):  # type: (...) -> ModelProto\n+        orig_model = helper.make_model(graph, producer_name='onnx-test', opset_imports=[initial_version])\n+        # print(type(orig_model))\n+        converted_model = onnx.version_converter.convert_version(orig_model,\n+                target_version)\n+        checker.check_model(converted_model)\n+        return converted_model\n+\n+    # fn is a function that takes a single node as argument\n+    def _visit_all_nodes_recursive(\n+            self,\n+            graph,  # type: GraphProto\n+            fn  # type: Callable[[NodeProto], None]\n+    ):  # type: (...) -> None\n+        for node in graph.node:\n+            fn(node)\n+            for attr in node.attribute:\n+                if attr.g is not None:\n+                    self._visit_all_nodes_recursive(attr.g, fn)\n+                if len(attr.graphs):\n+                    for gr in attr.graphs:\n+                        self._visit_all_nodes_recursive(gr, fn)\n+\n+    # Test 1: Backwards Incompatible Conversion: Add: 8 -> 2","path":"onnx/test/version_converter_test.py","position":null,"original_position":46,"commit_id":"48fce5f3af6e154791df5953c54ba798abde5d9f","original_commit_id":"c5581b5fcbfc7a9f7591758eb9dcc98636818fb2","user":{"login":"houseroad","id":30275821,"node_id":"MDQ6VXNlcjMwMjc1ODIx","avatar_url":"https://avatars0.githubusercontent.com/u/30275821?v=4","gravatar_id":"","url":"https://api.github.com/users/houseroad","html_url":"https://github.com/houseroad","followers_url":"https://api.github.com/users/houseroad/followers","following_url":"https://api.github.com/users/houseroad/following{/other_user}","gists_url":"https://api.github.com/users/houseroad/gists{/gist_id}","starred_url":"https://api.github.com/users/houseroad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houseroad/subscriptions","organizations_url":"https://api.github.com/users/houseroad/orgs","repos_url":"https://api.github.com/users/houseroad/repos","events_url":"https://api.github.com/users/houseroad/events{/privacy}","received_events_url":"https://api.github.com/users/houseroad/received_events","type":"User","site_admin":false},"body":"My point is that let's have a case, in which the adapter is not visible.","created_at":"2018-07-19T18:17:15Z","updated_at":"2018-07-19T18:17:15Z","html_url":"https://github.com/onnx/onnx/pull/1148#discussion_r203824453","pull_request_url":"https://api.github.com/repos/onnx/onnx/pulls/1148","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/onnx/onnx/pulls/comments/203824453"},"html":{"href":"https://github.com/onnx/onnx/pull/1148#discussion_r203824453"},"pull_request":{"href":"https://api.github.com/repos/onnx/onnx/pulls/1148"}},"in_reply_to_id":203823629},"pull_request":{"url":"https://api.github.com/repos/onnx/onnx/pulls/1148","id":197593035,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3NTkzMDM1","html_url":"https://github.com/onnx/onnx/pull/1148","diff_url":"https://github.com/onnx/onnx/pull/1148.diff","patch_url":"https://github.com/onnx/onnx/pull/1148.patch","issue_url":"https://api.github.com/repos/onnx/onnx/issues/1148","number":1148,"state":"open","locked":false,"title":"Opset Version Converter","user":{"login":"Ac2zoom","id":3822214,"node_id":"MDQ6VXNlcjM4MjIyMTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3822214?v=4","gravatar_id":"","url":"https://api.github.com/users/Ac2zoom","html_url":"https://github.com/Ac2zoom","followers_url":"https://api.github.com/users/Ac2zoom/followers","following_url":"https://api.github.com/users/Ac2zoom/following{/other_user}","gists_url":"https://api.github.com/users/Ac2zoom/gists{/gist_id}","starred_url":"https://api.github.com/users/Ac2zoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ac2zoom/subscriptions","organizations_url":"https://api.github.com/users/Ac2zoom/orgs","repos_url":"https://api.github.com/users/Ac2zoom/repos","events_url":"https://api.github.com/users/Ac2zoom/events{/privacy}","received_events_url":"https://api.github.com/users/Ac2zoom/received_events","type":"User","site_admin":false},"body":"A tool to convert an ingested model to any other opset version in any other domain, making both backwards compatibility and version updating easier.","created_at":"2018-06-27T01:25:18Z","updated_at":"2018-07-19T18:17:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0229abb0a46601c8eb3f309b4e984d5a0b2b1dec","assignee":null,"assignees":[],"requested_reviewers":[{"login":"anderspapitto","id":1388690,"node_id":"MDQ6VXNlcjEzODg2OTA=","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}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/onnx/onnx/pulls/1148/commits","review_comments_url":"https://api.github.com/repos/onnx/onnx/pulls/1148/comments","review_comment_url":"https://api.github.com/repos/onnx/onnx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onnx/onnx/issues/1148/comments","statuses_url":"https://api.github.com/repos/onnx/onnx/statuses/48fce5f3af6e154791df5953c54ba798abde5d9f","head":{"label":"Ac2zoom:version_converter","ref":"version_converter","sha":"48fce5f3af6e154791df5953c54ba798abde5d9f","user":{"login":"Ac2zoom","id":3822214,"node_id":"MDQ6VXNlcjM4MjIyMTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3822214?v=4","gravatar_id":"","url":"https://api.github.com/users/Ac2zoom","html_url":"https://github.com/Ac2zoom","followers_url":"https://api.github.com/users/Ac2zoom/followers","following_url":"https://api.github.com/users/Ac2zoom/following{/other_user}","gists_url":"https://api.github.com/users/Ac2zoom/gists{/gist_id}","starred_url":"https://api.github.com/users/Ac2zoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ac2zoom/subscriptions","organizations_url":"https://api.github.com/users/Ac2zoom/orgs","repos_url":"https://api.github.com/users/Ac2zoom/repos","events_url":"https://api.github.com/users/Ac2zoom/events{/privacy}","received_events_url":"https://api.github.com/users/Ac2zoom/received_events","type":"User","site_admin":false},"repo":{"id":138069347,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgwNjkzNDc=","name":"onnx","full_name":"Ac2zoom/onnx","owner":{"login":"Ac2zoom","id":3822214,"node_id":"MDQ6VXNlcjM4MjIyMTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3822214?v=4","gravatar_id":"","url":"https://api.github.com/users/Ac2zoom","html_url":"https://github.com/Ac2zoom","followers_url":"https://api.github.com/users/Ac2zoom/followers","following_url":"https://api.github.com/users/Ac2zoom/following{/other_user}","gists_url":"https://api.github.com/users/Ac2zoom/gists{/gist_id}","starred_url":"https://api.github.com/users/Ac2zoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ac2zoom/subscriptions","organizations_url":"https://api.github.com/users/Ac2zoom/orgs","repos_url":"https://api.github.com/users/Ac2zoom/repos","events_url":"https://api.github.com/users/Ac2zoom/events{/privacy}","received_events_url":"https://api.github.com/users/Ac2zoom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ac2zoom/onnx","description":"Open Neural Network Exchange","fork":true,"url":"https://api.github.com/repos/Ac2zoom/onnx","forks_url":"https://api.github.com/repos/Ac2zoom/onnx/forks","keys_url":"https://api.github.com/repos/Ac2zoom/onnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ac2zoom/onnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ac2zoom/onnx/teams","hooks_url":"https://api.github.com/repos/Ac2zoom/onnx/hooks","issue_events_url":"https://api.github.com/repos/Ac2zoom/onnx/issues/events{/number}","events_url":"https://api.github.com/repos/Ac2zoom/onnx/events","assignees_url":"https://api.github.com/repos/Ac2zoom/onnx/assignees{/user}","branches_url":"https://api.github.com/repos/Ac2zoom/onnx/branches{/branch}","tags_url":"https://api.github.com/repos/Ac2zoom/onnx/tags","blobs_url":"https://api.github.com/repos/Ac2zoom/onnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ac2zoom/onnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ac2zoom/onnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ac2zoom/onnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ac2zoom/onnx/statuses/{sha}","languages_url":"https://api.github.com/repos/Ac2zoom/onnx/languages","stargazers_url":"https://api.github.com/repos/Ac2zoom/onnx/stargazers","contributors_url":"https://api.github.com/repos/Ac2zoom/onnx/contributors","subscribers_url":"https://api.github.com/repos/Ac2zoom/onnx/subscribers","subscription_url":"https://api.github.com/repos/Ac2zoom/onnx/subscription","commits_url":"https://api.github.com/repos/Ac2zoom/onnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ac2zoom/onnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ac2zoom/onnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ac2zoom/onnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ac2zoom/onnx/contents/{+path}","compare_url":"https://api.github.com/repos/Ac2zoom/onnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ac2zoom/onnx/merges","archive_url":"https://api.github.com/repos/Ac2zoom/onnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ac2zoom/onnx/downloads","issues_url":"https://api.github.com/repos/Ac2zoom/onnx/issues{/number}","pulls_url":"https://api.github.com/repos/Ac2zoom/onnx/pulls{/number}","milestones_url":"https://api.github.com/repos/Ac2zoom/onnx/milestones{/number}","notifications_url":"https://api.github.com/repos/Ac2zoom/onnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ac2zoom/onnx/labels{/name}","releases_url":"https://api.github.com/repos/Ac2zoom/onnx/releases{/id}","deployments_url":"https://api.github.com/repos/Ac2zoom/onnx/deployments","created_at":"2018-06-20T18:11:58Z","updated_at":"2018-06-27T22:34:03Z","pushed_at":"2018-07-19T18:16:19Z","git_url":"git://github.com/Ac2zoom/onnx.git","ssh_url":"git@github.com:Ac2zoom/onnx.git","clone_url":"https://github.com/Ac2zoom/onnx.git","svn_url":"https://github.com/Ac2zoom/onnx","homepage":"https://onnx.ai/","size":6380,"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,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"onnx:master","ref":"master","sha":"f09d8d6b15c4c46d8217b3e784d0217f839da75e","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":102692863,"node_id":"MDEwOlJlcG9zaXRvcnkxMDI2OTI4NjM=","name":"onnx","full_name":"onnx/onnx","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},"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-07-19T17:56:12Z","pushed_at":"2018-07-19T18:16:20Z","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":6104,"stargazers_count":3859,"watchers_count":3859,"language":"PureBasic","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":511,"mirror_url":null,"archived":false,"open_issues_count":200,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":511,"open_issues":200,"watchers":3859,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onnx/onnx/pulls/1148"},"html":{"href":"https://github.com/onnx/onnx/pull/1148"},"issue":{"href":"https://api.github.com/repos/onnx/onnx/issues/1148"},"comments":{"href":"https://api.github.com/repos/onnx/onnx/issues/1148/comments"},"review_comments":{"href":"https://api.github.com/repos/onnx/onnx/pulls/1148/comments"},"review_comment":{"href":"https://api.github.com/repos/onnx/onnx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onnx/onnx/pulls/1148/commits"},"statuses":{"href":"https://api.github.com/repos/onnx/onnx/statuses/48fce5f3af6e154791df5953c54ba798abde5d9f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"houseroad"}}