{"action":"created","comment":{"url":"https://api.github.com/repos/onnx/onnx/pulls/comments/191408431","pull_request_review_id":123973359,"id":191408431,"diff_hunk":"@@ -0,0 +1,65 @@\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+import numpy as np  # type: ignore\n+\n+import onnx\n+import math\n+from ..base import Base\n+from . import expect\n+\n+\n+class LRN(Base):\n+\n+    @staticmethod\n+    def export():\n+        alpha = 0.0002\n+        beta = 0.5\n+        bias = 2.0\n+        nsize = 3\n+        node = onnx.helper.make_node(\n+            'LRN',\n+            inputs=['x'],\n+            outputs=['y'],\n+            alpha=alpha,\n+            beta=beta,\n+            bias=bias,\n+            size=nsize\n+        )\n+        x = np.random.rand(5, 5, 5, 5).astype(np.float32) * 1000\n+        square_sum = np.zeros((5,5,5,5))\n+        for n,c,h,w in np.ndindex(x.shape):\n+            square_sum[n,c,h,w] = sum(x[n,\n+                                        max(0, c - int(math.floor((nsize - 1) / 2)))\n+                                        :min(4, c + int(math.ceil((nsize - 1) / 2)) + 1),\n+                                        h,\n+                                        w] ** 2)\n+        y = x / ((bias + (alpha / nsize) * square_sum) ** beta)\n+        expect(node, inputs=[x], outputs=[y],\n+               name='test_lrn')\n+\n+    @staticmethod\n+    def export_default():\n+        alpha = 0.0001\n+        beta = 0.75\n+        bias = 1.0\n+        nsize = 3\n+        node = onnx.helper.make_node(\n+            'LRN',\n+            inputs=['x'],\n+            outputs=['y'],\n+            size=3\n+        )\n+        x = np.random.rand(5, 5, 5, 5).astype(np.float32) * 1000\n+        square_sum = np.zeros((5,5,5,5))","path":"onnx/backend/test/case/node/lrn.py","position":56,"original_position":56,"commit_id":"62b834674559621d74ad995b714aba955f4d08b3","original_commit_id":"62b834674559621d74ad995b714aba955f4d08b3","user":{"login":"houseroad","id":30275821,"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":"default is float64, please convert it to float32.","created_at":"2018-05-29T12:44:50Z","updated_at":"2018-05-29T12:45:25Z","html_url":"https://github.com/onnx/onnx/pull/903#discussion_r191408431","pull_request_url":"https://api.github.com/repos/onnx/onnx/pulls/903","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/onnx/onnx/pulls/comments/191408431"},"html":{"href":"https://github.com/onnx/onnx/pull/903#discussion_r191408431"},"pull_request":{"href":"https://api.github.com/repos/onnx/onnx/pulls/903"}}},"pull_request":{"url":"https://api.github.com/repos/onnx/onnx/pulls/903","id":186468026,"html_url":"https://github.com/onnx/onnx/pull/903","diff_url":"https://github.com/onnx/onnx/pull/903.diff","patch_url":"https://github.com/onnx/onnx/pull/903.patch","issue_url":"https://api.github.com/repos/onnx/onnx/issues/903","number":903,"state":"open","locked":false,"title":"Tests for LRN operator","user":{"login":"anirudhacharya","id":2778341,"avatar_url":"https://avatars0.githubusercontent.com/u/2778341?v=4","gravatar_id":"","url":"https://api.github.com/users/anirudhacharya","html_url":"https://github.com/anirudhacharya","followers_url":"https://api.github.com/users/anirudhacharya/followers","following_url":"https://api.github.com/users/anirudhacharya/following{/other_user}","gists_url":"https://api.github.com/users/anirudhacharya/gists{/gist_id}","starred_url":"https://api.github.com/users/anirudhacharya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anirudhacharya/subscriptions","organizations_url":"https://api.github.com/users/anirudhacharya/orgs","repos_url":"https://api.github.com/users/anirudhacharya/repos","events_url":"https://api.github.com/users/anirudhacharya/events{/privacy}","received_events_url":"https://api.github.com/users/anirudhacharya/received_events","type":"User","site_admin":false},"body":"- [x] Need to add a test case where the window size is greater than 1.\r\n- [x] Clarify the definition of the operator. Is the normalization happing within the channel or across the channel. How to ascertain the window of the local region?","created_at":"2018-05-07T21:20:07Z","updated_at":"2018-05-29T12:45:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6aeb3b85add66134ac1e40277dbfea694855c413","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bddppq","id":9300575,"avatar_url":"https://avatars2.githubusercontent.com/u/9300575?v=4","gravatar_id":"","url":"https://api.github.com/users/bddppq","html_url":"https://github.com/bddppq","followers_url":"https://api.github.com/users/bddppq/followers","following_url":"https://api.github.com/users/bddppq/following{/other_user}","gists_url":"https://api.github.com/users/bddppq/gists{/gist_id}","starred_url":"https://api.github.com/users/bddppq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bddppq/subscriptions","organizations_url":"https://api.github.com/users/bddppq/orgs","repos_url":"https://api.github.com/users/bddppq/repos","events_url":"https://api.github.com/users/bddppq/events{/privacy}","received_events_url":"https://api.github.com/users/bddppq/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/onnx/onnx/pulls/903/commits","review_comments_url":"https://api.github.com/repos/onnx/onnx/pulls/903/comments","review_comment_url":"https://api.github.com/repos/onnx/onnx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onnx/onnx/issues/903/comments","statuses_url":"https://api.github.com/repos/onnx/onnx/statuses/62b834674559621d74ad995b714aba955f4d08b3","head":{"label":"anirudhacharya:lrn","ref":"lrn","sha":"62b834674559621d74ad995b714aba955f4d08b3","user":{"login":"anirudhacharya","id":2778341,"avatar_url":"https://avatars0.githubusercontent.com/u/2778341?v=4","gravatar_id":"","url":"https://api.github.com/users/anirudhacharya","html_url":"https://github.com/anirudhacharya","followers_url":"https://api.github.com/users/anirudhacharya/followers","following_url":"https://api.github.com/users/anirudhacharya/following{/other_user}","gists_url":"https://api.github.com/users/anirudhacharya/gists{/gist_id}","starred_url":"https://api.github.com/users/anirudhacharya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anirudhacharya/subscriptions","organizations_url":"https://api.github.com/users/anirudhacharya/orgs","repos_url":"https://api.github.com/users/anirudhacharya/repos","events_url":"https://api.github.com/users/anirudhacharya/events{/privacy}","received_events_url":"https://api.github.com/users/anirudhacharya/received_events","type":"User","site_admin":false},"repo":{"id":120801557,"name":"onnx","full_name":"anirudhacharya/onnx","owner":{"login":"anirudhacharya","id":2778341,"avatar_url":"https://avatars0.githubusercontent.com/u/2778341?v=4","gravatar_id":"","url":"https://api.github.com/users/anirudhacharya","html_url":"https://github.com/anirudhacharya","followers_url":"https://api.github.com/users/anirudhacharya/followers","following_url":"https://api.github.com/users/anirudhacharya/following{/other_user}","gists_url":"https://api.github.com/users/anirudhacharya/gists{/gist_id}","starred_url":"https://api.github.com/users/anirudhacharya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anirudhacharya/subscriptions","organizations_url":"https://api.github.com/users/anirudhacharya/orgs","repos_url":"https://api.github.com/users/anirudhacharya/repos","events_url":"https://api.github.com/users/anirudhacharya/events{/privacy}","received_events_url":"https://api.github.com/users/anirudhacharya/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anirudhacharya/onnx","description":"Open Neural Network Exchange","fork":true,"url":"https://api.github.com/repos/anirudhacharya/onnx","forks_url":"https://api.github.com/repos/anirudhacharya/onnx/forks","keys_url":"https://api.github.com/repos/anirudhacharya/onnx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anirudhacharya/onnx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anirudhacharya/onnx/teams","hooks_url":"https://api.github.com/repos/anirudhacharya/onnx/hooks","issue_events_url":"https://api.github.com/repos/anirudhacharya/onnx/issues/events{/number}","events_url":"https://api.github.com/repos/anirudhacharya/onnx/events","assignees_url":"https://api.github.com/repos/anirudhacharya/onnx/assignees{/user}","branches_url":"https://api.github.com/repos/anirudhacharya/onnx/branches{/branch}","tags_url":"https://api.github.com/repos/anirudhacharya/onnx/tags","blobs_url":"https://api.github.com/repos/anirudhacharya/onnx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anirudhacharya/onnx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anirudhacharya/onnx/git/refs{/sha}","trees_url":"https://api.github.com/repos/anirudhacharya/onnx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anirudhacharya/onnx/statuses/{sha}","languages_url":"https://api.github.com/repos/anirudhacharya/onnx/languages","stargazers_url":"https://api.github.com/repos/anirudhacharya/onnx/stargazers","contributors_url":"https://api.github.com/repos/anirudhacharya/onnx/contributors","subscribers_url":"https://api.github.com/repos/anirudhacharya/onnx/subscribers","subscription_url":"https://api.github.com/repos/anirudhacharya/onnx/subscription","commits_url":"https://api.github.com/repos/anirudhacharya/onnx/commits{/sha}","git_commits_url":"https://api.github.com/repos/anirudhacharya/onnx/git/commits{/sha}","comments_url":"https://api.github.com/repos/anirudhacharya/onnx/comments{/number}","issue_comment_url":"https://api.github.com/repos/anirudhacharya/onnx/issues/comments{/number}","contents_url":"https://api.github.com/repos/anirudhacharya/onnx/contents/{+path}","compare_url":"https://api.github.com/repos/anirudhacharya/onnx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anirudhacharya/onnx/merges","archive_url":"https://api.github.com/repos/anirudhacharya/onnx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anirudhacharya/onnx/downloads","issues_url":"https://api.github.com/repos/anirudhacharya/onnx/issues{/number}","pulls_url":"https://api.github.com/repos/anirudhacharya/onnx/pulls{/number}","milestones_url":"https://api.github.com/repos/anirudhacharya/onnx/milestones{/number}","notifications_url":"https://api.github.com/repos/anirudhacharya/onnx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anirudhacharya/onnx/labels{/name}","releases_url":"https://api.github.com/repos/anirudhacharya/onnx/releases{/id}","deployments_url":"https://api.github.com/repos/anirudhacharya/onnx/deployments","created_at":"2018-02-08T18:37:06Z","updated_at":"2018-05-27T06:06:39Z","pushed_at":"2018-05-28T16:18:17Z","git_url":"git://github.com/anirudhacharya/onnx.git","ssh_url":"git@github.com:anirudhacharya/onnx.git","clone_url":"https://github.com/anirudhacharya/onnx.git","svn_url":"https://github.com/anirudhacharya/onnx","homepage":"https://onnx.ai/","size":5497,"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":"ec3b6797b71663a42d5fe909845e4e25f246d43d","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-29T12:23:09Z","pushed_at":"2018-05-29T05:51:43Z","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":5191,"stargazers_count":3527,"watchers_count":3527,"language":"PureBasic","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":450,"mirror_url":null,"archived":false,"open_issues_count":180,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":450,"open_issues":180,"watchers":3527,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onnx/onnx/pulls/903"},"html":{"href":"https://github.com/onnx/onnx/pull/903"},"issue":{"href":"https://api.github.com/repos/onnx/onnx/issues/903"},"comments":{"href":"https://api.github.com/repos/onnx/onnx/issues/903/comments"},"review_comments":{"href":"https://api.github.com/repos/onnx/onnx/pulls/903/comments"},"review_comment":{"href":"https://api.github.com/repos/onnx/onnx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onnx/onnx/pulls/903/commits"},"statuses":{"href":"https://api.github.com/repos/onnx/onnx/statuses/62b834674559621d74ad995b714aba955f4d08b3"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houseroad"}}