{"action":"created","comment":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/comments/51122678","id":51122678,"diff_hunk":"@@ -367,6 +367,54 @@ def test_addgrad_gpu_to_another_gpu(self):\n         self.check_addgrad(a, b, c)\n \n \n+class TestDebugPrint(unittest.TestCase):\n+\n+    def setUp(self):\n+        self.arr = np.random.randn(5, 3, 5, 5).astype(np.float32)\n+\n+    def check_debug_print(self, v):\n+        result = v.debug_print()\n+        self.assertTrue(repr(v) in result)\n+        self.assertTrue('volatile: OFF' in result)\n+        self.assertTrue(\"dtype: float32\" in result)\n+\n+        # no grad\n+        msg = \"statistics: mean=\"\n+        self.assertTrue(msg in result)\n+        self.assertTrue(\"grad: None\" in result)\n+\n+        # zero grad\n+        v.zerograd()\n+        result = v.debug_print()\n+        self.assertTrue(\"grad: 0\" in result)\n+\n+        # add grad\n+        v.grad = v.data\n+        result = v.debug_print()\n+\n+        msg = \"grad: mean=\"\n+        self.assertTrue(msg in result)","path":"tests/chainer_tests/test_variable.py","position":30,"original_position":30,"commit_id":"33dde670645caf002c817aae6c46297a31463bb4","original_commit_id":"33dde670645caf002c817aae6c46297a31463bb4","user":{"login":"delta2323","id":407052,"avatar_url":"https://avatars.githubusercontent.com/u/407052?v=3","gravatar_id":"","url":"https://api.github.com/users/delta2323","html_url":"https://github.com/delta2323","followers_url":"https://api.github.com/users/delta2323/followers","following_url":"https://api.github.com/users/delta2323/following{/other_user}","gists_url":"https://api.github.com/users/delta2323/gists{/gist_id}","starred_url":"https://api.github.com/users/delta2323/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delta2323/subscriptions","organizations_url":"https://api.github.com/users/delta2323/orgs","repos_url":"https://api.github.com/users/delta2323/repos","events_url":"https://api.github.com/users/delta2323/events{/privacy}","received_events_url":"https://api.github.com/users/delta2323/received_events","type":"User","site_admin":false},"body":"ditto (check that statistics should include stddev)","created_at":"2016-01-28T13:40:11Z","updated_at":"2016-01-28T13:40:11Z","html_url":"https://github.com/pfnet/chainer/pull/830#discussion_r51122678","pull_request_url":"https://api.github.com/repos/pfnet/chainer/pulls/830","_links":{"self":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/comments/51122678"},"html":{"href":"https://github.com/pfnet/chainer/pull/830#discussion_r51122678"},"pull_request":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/830"}}},"pull_request":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/830","id":55212509,"html_url":"https://github.com/pfnet/chainer/pull/830","diff_url":"https://github.com/pfnet/chainer/pull/830.diff","patch_url":"https://github.com/pfnet/chainer/pull/830.patch","issue_url":"https://api.github.com/repos/pfnet/chainer/issues/830","number":830,"state":"open","locked":false,"title":"Add Variable.debug_print method","user":{"login":"sinhrks","id":1696302,"avatar_url":"https://avatars.githubusercontent.com/u/1696302?v=3","gravatar_id":"","url":"https://api.github.com/users/sinhrks","html_url":"https://github.com/sinhrks","followers_url":"https://api.github.com/users/sinhrks/followers","following_url":"https://api.github.com/users/sinhrks/following{/other_user}","gists_url":"https://api.github.com/users/sinhrks/gists{/gist_id}","starred_url":"https://api.github.com/users/sinhrks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinhrks/subscriptions","organizations_url":"https://api.github.com/users/sinhrks/orgs","repos_url":"https://api.github.com/users/sinhrks/repos","events_url":"https://api.github.com/users/sinhrks/events{/privacy}","received_events_url":"https://api.github.com/users/sinhrks/received_events","type":"User","site_admin":false},"body":"Closes #786. \r\n\r\n@delta2323  Could you take a look?","created_at":"2016-01-06T13:28:25Z","updated_at":"2016-01-28T13:40:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3061208575f100191c1d28e0721b7c68a62e7f12","assignee":{"login":"delta2323","id":407052,"avatar_url":"https://avatars.githubusercontent.com/u/407052?v=3","gravatar_id":"","url":"https://api.github.com/users/delta2323","html_url":"https://github.com/delta2323","followers_url":"https://api.github.com/users/delta2323/followers","following_url":"https://api.github.com/users/delta2323/following{/other_user}","gists_url":"https://api.github.com/users/delta2323/gists{/gist_id}","starred_url":"https://api.github.com/users/delta2323/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/delta2323/subscriptions","organizations_url":"https://api.github.com/users/delta2323/orgs","repos_url":"https://api.github.com/users/delta2323/repos","events_url":"https://api.github.com/users/delta2323/events{/privacy}","received_events_url":"https://api.github.com/users/delta2323/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pfnet/chainer/pulls/830/commits","review_comments_url":"https://api.github.com/repos/pfnet/chainer/pulls/830/comments","review_comment_url":"https://api.github.com/repos/pfnet/chainer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pfnet/chainer/issues/830/comments","statuses_url":"https://api.github.com/repos/pfnet/chainer/statuses/33dde670645caf002c817aae6c46297a31463bb4","head":{"label":"sinhrks:debugprint","ref":"debugprint","sha":"33dde670645caf002c817aae6c46297a31463bb4","user":{"login":"sinhrks","id":1696302,"avatar_url":"https://avatars.githubusercontent.com/u/1696302?v=3","gravatar_id":"","url":"https://api.github.com/users/sinhrks","html_url":"https://github.com/sinhrks","followers_url":"https://api.github.com/users/sinhrks/followers","following_url":"https://api.github.com/users/sinhrks/following{/other_user}","gists_url":"https://api.github.com/users/sinhrks/gists{/gist_id}","starred_url":"https://api.github.com/users/sinhrks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinhrks/subscriptions","organizations_url":"https://api.github.com/users/sinhrks/orgs","repos_url":"https://api.github.com/users/sinhrks/repos","events_url":"https://api.github.com/users/sinhrks/events{/privacy}","received_events_url":"https://api.github.com/users/sinhrks/received_events","type":"User","site_admin":false},"repo":{"id":37196670,"name":"chainer","full_name":"sinhrks/chainer","owner":{"login":"sinhrks","id":1696302,"avatar_url":"https://avatars.githubusercontent.com/u/1696302?v=3","gravatar_id":"","url":"https://api.github.com/users/sinhrks","html_url":"https://github.com/sinhrks","followers_url":"https://api.github.com/users/sinhrks/followers","following_url":"https://api.github.com/users/sinhrks/following{/other_user}","gists_url":"https://api.github.com/users/sinhrks/gists{/gist_id}","starred_url":"https://api.github.com/users/sinhrks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinhrks/subscriptions","organizations_url":"https://api.github.com/users/sinhrks/orgs","repos_url":"https://api.github.com/users/sinhrks/repos","events_url":"https://api.github.com/users/sinhrks/events{/privacy}","received_events_url":"https://api.github.com/users/sinhrks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sinhrks/chainer","description":"A flexible framework of neural networks for deep learning","fork":true,"url":"https://api.github.com/repos/sinhrks/chainer","forks_url":"https://api.github.com/repos/sinhrks/chainer/forks","keys_url":"https://api.github.com/repos/sinhrks/chainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sinhrks/chainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sinhrks/chainer/teams","hooks_url":"https://api.github.com/repos/sinhrks/chainer/hooks","issue_events_url":"https://api.github.com/repos/sinhrks/chainer/issues/events{/number}","events_url":"https://api.github.com/repos/sinhrks/chainer/events","assignees_url":"https://api.github.com/repos/sinhrks/chainer/assignees{/user}","branches_url":"https://api.github.com/repos/sinhrks/chainer/branches{/branch}","tags_url":"https://api.github.com/repos/sinhrks/chainer/tags","blobs_url":"https://api.github.com/repos/sinhrks/chainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sinhrks/chainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sinhrks/chainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/sinhrks/chainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sinhrks/chainer/statuses/{sha}","languages_url":"https://api.github.com/repos/sinhrks/chainer/languages","stargazers_url":"https://api.github.com/repos/sinhrks/chainer/stargazers","contributors_url":"https://api.github.com/repos/sinhrks/chainer/contributors","subscribers_url":"https://api.github.com/repos/sinhrks/chainer/subscribers","subscription_url":"https://api.github.com/repos/sinhrks/chainer/subscription","commits_url":"https://api.github.com/repos/sinhrks/chainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/sinhrks/chainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/sinhrks/chainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/sinhrks/chainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/sinhrks/chainer/contents/{+path}","compare_url":"https://api.github.com/repos/sinhrks/chainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sinhrks/chainer/merges","archive_url":"https://api.github.com/repos/sinhrks/chainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sinhrks/chainer/downloads","issues_url":"https://api.github.com/repos/sinhrks/chainer/issues{/number}","pulls_url":"https://api.github.com/repos/sinhrks/chainer/pulls{/number}","milestones_url":"https://api.github.com/repos/sinhrks/chainer/milestones{/number}","notifications_url":"https://api.github.com/repos/sinhrks/chainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sinhrks/chainer/labels{/name}","releases_url":"https://api.github.com/repos/sinhrks/chainer/releases{/id}","deployments_url":"https://api.github.com/repos/sinhrks/chainer/deployments","created_at":"2015-06-10T12:47:06Z","updated_at":"2016-01-17T03:08:02Z","pushed_at":"2016-01-27T13:48:26Z","git_url":"git://github.com/sinhrks/chainer.git","ssh_url":"git@github.com:sinhrks/chainer.git","clone_url":"https://github.com/sinhrks/chainer.git","svn_url":"https://github.com/sinhrks/chainer","homepage":"http://chainer.org","size":9267,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pfnet:master","ref":"master","sha":"145b8292c249f7e0f278ace2cef8fa66f9ebdca3","user":{"login":"pfnet","id":9739572,"avatar_url":"https://avatars.githubusercontent.com/u/9739572?v=3","gravatar_id":"","url":"https://api.github.com/users/pfnet","html_url":"https://github.com/pfnet","followers_url":"https://api.github.com/users/pfnet/followers","following_url":"https://api.github.com/users/pfnet/following{/other_user}","gists_url":"https://api.github.com/users/pfnet/gists{/gist_id}","starred_url":"https://api.github.com/users/pfnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfnet/subscriptions","organizations_url":"https://api.github.com/users/pfnet/orgs","repos_url":"https://api.github.com/users/pfnet/repos","events_url":"https://api.github.com/users/pfnet/events{/privacy}","received_events_url":"https://api.github.com/users/pfnet/received_events","type":"Organization","site_admin":false},"repo":{"id":36914478,"name":"chainer","full_name":"pfnet/chainer","owner":{"login":"pfnet","id":9739572,"avatar_url":"https://avatars.githubusercontent.com/u/9739572?v=3","gravatar_id":"","url":"https://api.github.com/users/pfnet","html_url":"https://github.com/pfnet","followers_url":"https://api.github.com/users/pfnet/followers","following_url":"https://api.github.com/users/pfnet/following{/other_user}","gists_url":"https://api.github.com/users/pfnet/gists{/gist_id}","starred_url":"https://api.github.com/users/pfnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfnet/subscriptions","organizations_url":"https://api.github.com/users/pfnet/orgs","repos_url":"https://api.github.com/users/pfnet/repos","events_url":"https://api.github.com/users/pfnet/events{/privacy}","received_events_url":"https://api.github.com/users/pfnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pfnet/chainer","description":"A flexible framework of neural networks for deep learning","fork":false,"url":"https://api.github.com/repos/pfnet/chainer","forks_url":"https://api.github.com/repos/pfnet/chainer/forks","keys_url":"https://api.github.com/repos/pfnet/chainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pfnet/chainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pfnet/chainer/teams","hooks_url":"https://api.github.com/repos/pfnet/chainer/hooks","issue_events_url":"https://api.github.com/repos/pfnet/chainer/issues/events{/number}","events_url":"https://api.github.com/repos/pfnet/chainer/events","assignees_url":"https://api.github.com/repos/pfnet/chainer/assignees{/user}","branches_url":"https://api.github.com/repos/pfnet/chainer/branches{/branch}","tags_url":"https://api.github.com/repos/pfnet/chainer/tags","blobs_url":"https://api.github.com/repos/pfnet/chainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pfnet/chainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pfnet/chainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/pfnet/chainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pfnet/chainer/statuses/{sha}","languages_url":"https://api.github.com/repos/pfnet/chainer/languages","stargazers_url":"https://api.github.com/repos/pfnet/chainer/stargazers","contributors_url":"https://api.github.com/repos/pfnet/chainer/contributors","subscribers_url":"https://api.github.com/repos/pfnet/chainer/subscribers","subscription_url":"https://api.github.com/repos/pfnet/chainer/subscription","commits_url":"https://api.github.com/repos/pfnet/chainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/pfnet/chainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/pfnet/chainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/pfnet/chainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/pfnet/chainer/contents/{+path}","compare_url":"https://api.github.com/repos/pfnet/chainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pfnet/chainer/merges","archive_url":"https://api.github.com/repos/pfnet/chainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pfnet/chainer/downloads","issues_url":"https://api.github.com/repos/pfnet/chainer/issues{/number}","pulls_url":"https://api.github.com/repos/pfnet/chainer/pulls{/number}","milestones_url":"https://api.github.com/repos/pfnet/chainer/milestones{/number}","notifications_url":"https://api.github.com/repos/pfnet/chainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pfnet/chainer/labels{/name}","releases_url":"https://api.github.com/repos/pfnet/chainer/releases{/id}","deployments_url":"https://api.github.com/repos/pfnet/chainer/deployments","created_at":"2015-06-05T05:50:37Z","updated_at":"2016-01-27T15:21:33Z","pushed_at":"2016-01-28T12:12:28Z","git_url":"git://github.com/pfnet/chainer.git","ssh_url":"git@github.com:pfnet/chainer.git","clone_url":"https://github.com/pfnet/chainer.git","svn_url":"https://github.com/pfnet/chainer","homepage":"http://chainer.org","size":13679,"stargazers_count":1136,"watchers_count":1136,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":203,"mirror_url":null,"open_issues_count":132,"forks":203,"open_issues":132,"watchers":1136,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/830"},"html":{"href":"https://github.com/pfnet/chainer/pull/830"},"issue":{"href":"https://api.github.com/repos/pfnet/chainer/issues/830"},"comments":{"href":"https://api.github.com/repos/pfnet/chainer/issues/830/comments"},"review_comments":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/830/comments"},"review_comment":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/830/commits"},"statuses":{"href":"https://api.github.com/repos/pfnet/chainer/statuses/33dde670645caf002c817aae6c46297a31463bb4"}}}}