{"action":"created","comment":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/comments/65817529","id":65817529,"diff_hunk":"@@ -6,12 +6,64 @@\n # class r_(object):\n # class s_(object):\n \n-\n+import numpy\n+import cupy\n # TODO(okuta): Implement indices\n \n \n # TODO(okuta): Implement ix_\n-\n+def ix_(*args):\n+    \"\"\"Construct an open mesh from multiple sequences.\n+\n+    This function takes N 1-D sequences and returns N outputs with N\n+    dimensions each, such that the shape is 1 in all but one dimension\n+    and the dimension with the non-unit shape value cycles through all\n+    N dimensions.\n+\n+    Using `ix_` one can quickly construct index arrays that will index\n+    the cross product. ``a[np.ix_([1,3],[2,5])]`` returns the array\n+    ``[[a[1,2] a[1,5]], [a[3,2] a[3,5]]]``.\n+\n+    Args:\n+        *args: 1-D sequences\n+\n+    Returns: tuple of ndarrays","path":"cupy/indexing/generate.py","position":27,"original_position":27,"commit_id":"6eeebaf7dd52b7b721cbe8a4ecb9a8acf34df278","original_commit_id":"6eeebaf7dd52b7b721cbe8a4ecb9a8acf34df278","user":{"login":"okuta","id":7133388,"avatar_url":"https://avatars.githubusercontent.com/u/7133388?v=3","gravatar_id":"","url":"https://api.github.com/users/okuta","html_url":"https://github.com/okuta","followers_url":"https://api.github.com/users/okuta/followers","following_url":"https://api.github.com/users/okuta/following{/other_user}","gists_url":"https://api.github.com/users/okuta/gists{/gist_id}","starred_url":"https://api.github.com/users/okuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okuta/subscriptions","organizations_url":"https://api.github.com/users/okuta/orgs","repos_url":"https://api.github.com/users/okuta/repos","events_url":"https://api.github.com/users/okuta/events{/privacy}","received_events_url":"https://api.github.com/users/okuta/received_events","type":"User","site_admin":false},"body":"Please fix comment style.","created_at":"2016-06-05T13:32:07Z","updated_at":"2016-06-05T13:32:08Z","html_url":"https://github.com/pfnet/chainer/pull/1172#discussion_r65817529","pull_request_url":"https://api.github.com/repos/pfnet/chainer/pulls/1172","_links":{"self":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/comments/65817529"},"html":{"href":"https://github.com/pfnet/chainer/pull/1172#discussion_r65817529"},"pull_request":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1172"}}},"pull_request":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/1172","id":69617454,"html_url":"https://github.com/pfnet/chainer/pull/1172","diff_url":"https://github.com/pfnet/chainer/pull/1172.diff","patch_url":"https://github.com/pfnet/chainer/pull/1172.patch","issue_url":"https://api.github.com/repos/pfnet/chainer/issues/1172","number":1172,"state":"open","locked":false,"title":"add cupy.nonzero, cupy.flatnonzero, cupy.ix_","user":{"login":"kikusu","id":7224921,"avatar_url":"https://avatars.githubusercontent.com/u/7224921?v=3","gravatar_id":"","url":"https://api.github.com/users/kikusu","html_url":"https://github.com/kikusu","followers_url":"https://api.github.com/users/kikusu/followers","following_url":"https://api.github.com/users/kikusu/following{/other_user}","gists_url":"https://api.github.com/users/kikusu/gists{/gist_id}","starred_url":"https://api.github.com/users/kikusu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kikusu/subscriptions","organizations_url":"https://api.github.com/users/kikusu/orgs","repos_url":"https://api.github.com/users/kikusu/repos","events_url":"https://api.github.com/users/kikusu/events{/privacy}","received_events_url":"https://api.github.com/users/kikusu/received_events","type":"User","site_admin":false},"body":"This PR is add some  cupy functions.\r\n- cupy.nonzero\r\n- cupy.flatnonzero\r\n- cupy.ix_\r\n- cupy.ndarray.nonzero\r\n\r\n#### Impliment\r\n1. src = [-1, 1, 0, 2]\r\n2. candidate = src != 0 ==> \\[ True, True, False, True \\] (bool array) ==> \\[1, 1, 0, 1\\] (int array)\r\n3. scan = inclusive_scan( candidate) ==> [ 1, 2, 2, 3 ]\r\n4. for i in xrange(len(src) ): nonzero[ scan[n]-1 ] = n if src[n] != 0\r\n5. nonzero ==> [ 0, 1, 3]\r\n","created_at":"2016-05-11T05:37:53Z","updated_at":"2016-06-05T13:32:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"324b046211376e796c405bc28efdf663d97e9052","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pfnet/chainer/pulls/1172/commits","review_comments_url":"https://api.github.com/repos/pfnet/chainer/pulls/1172/comments","review_comment_url":"https://api.github.com/repos/pfnet/chainer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pfnet/chainer/issues/1172/comments","statuses_url":"https://api.github.com/repos/pfnet/chainer/statuses/6eeebaf7dd52b7b721cbe8a4ecb9a8acf34df278","head":{"label":"kikusu:feature/nonzero","ref":"feature/nonzero","sha":"6eeebaf7dd52b7b721cbe8a4ecb9a8acf34df278","user":{"login":"kikusu","id":7224921,"avatar_url":"https://avatars.githubusercontent.com/u/7224921?v=3","gravatar_id":"","url":"https://api.github.com/users/kikusu","html_url":"https://github.com/kikusu","followers_url":"https://api.github.com/users/kikusu/followers","following_url":"https://api.github.com/users/kikusu/following{/other_user}","gists_url":"https://api.github.com/users/kikusu/gists{/gist_id}","starred_url":"https://api.github.com/users/kikusu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kikusu/subscriptions","organizations_url":"https://api.github.com/users/kikusu/orgs","repos_url":"https://api.github.com/users/kikusu/repos","events_url":"https://api.github.com/users/kikusu/events{/privacy}","received_events_url":"https://api.github.com/users/kikusu/received_events","type":"User","site_admin":false},"repo":{"id":37410254,"name":"chainer","full_name":"kikusu/chainer","owner":{"login":"kikusu","id":7224921,"avatar_url":"https://avatars.githubusercontent.com/u/7224921?v=3","gravatar_id":"","url":"https://api.github.com/users/kikusu","html_url":"https://github.com/kikusu","followers_url":"https://api.github.com/users/kikusu/followers","following_url":"https://api.github.com/users/kikusu/following{/other_user}","gists_url":"https://api.github.com/users/kikusu/gists{/gist_id}","starred_url":"https://api.github.com/users/kikusu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kikusu/subscriptions","organizations_url":"https://api.github.com/users/kikusu/orgs","repos_url":"https://api.github.com/users/kikusu/repos","events_url":"https://api.github.com/users/kikusu/events{/privacy}","received_events_url":"https://api.github.com/users/kikusu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kikusu/chainer","description":"A flexible framework of neural networks for deep learning","fork":true,"url":"https://api.github.com/repos/kikusu/chainer","forks_url":"https://api.github.com/repos/kikusu/chainer/forks","keys_url":"https://api.github.com/repos/kikusu/chainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kikusu/chainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kikusu/chainer/teams","hooks_url":"https://api.github.com/repos/kikusu/chainer/hooks","issue_events_url":"https://api.github.com/repos/kikusu/chainer/issues/events{/number}","events_url":"https://api.github.com/repos/kikusu/chainer/events","assignees_url":"https://api.github.com/repos/kikusu/chainer/assignees{/user}","branches_url":"https://api.github.com/repos/kikusu/chainer/branches{/branch}","tags_url":"https://api.github.com/repos/kikusu/chainer/tags","blobs_url":"https://api.github.com/repos/kikusu/chainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kikusu/chainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kikusu/chainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/kikusu/chainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kikusu/chainer/statuses/{sha}","languages_url":"https://api.github.com/repos/kikusu/chainer/languages","stargazers_url":"https://api.github.com/repos/kikusu/chainer/stargazers","contributors_url":"https://api.github.com/repos/kikusu/chainer/contributors","subscribers_url":"https://api.github.com/repos/kikusu/chainer/subscribers","subscription_url":"https://api.github.com/repos/kikusu/chainer/subscription","commits_url":"https://api.github.com/repos/kikusu/chainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/kikusu/chainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/kikusu/chainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/kikusu/chainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/kikusu/chainer/contents/{+path}","compare_url":"https://api.github.com/repos/kikusu/chainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kikusu/chainer/merges","archive_url":"https://api.github.com/repos/kikusu/chainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kikusu/chainer/downloads","issues_url":"https://api.github.com/repos/kikusu/chainer/issues{/number}","pulls_url":"https://api.github.com/repos/kikusu/chainer/pulls{/number}","milestones_url":"https://api.github.com/repos/kikusu/chainer/milestones{/number}","notifications_url":"https://api.github.com/repos/kikusu/chainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kikusu/chainer/labels{/name}","releases_url":"https://api.github.com/repos/kikusu/chainer/releases{/id}","deployments_url":"https://api.github.com/repos/kikusu/chainer/deployments","created_at":"2015-06-14T11:45:20Z","updated_at":"2016-05-07T13:39:33Z","pushed_at":"2016-05-18T01:48:18Z","git_url":"git://github.com/kikusu/chainer.git","ssh_url":"git@github.com:kikusu/chainer.git","clone_url":"https://github.com/kikusu/chainer.git","svn_url":"https://github.com/kikusu/chainer","homepage":"http://chainer.org","size":9989,"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":"aa166431693a84e3def330d8aea2f0702cca1e04","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-06-05T13:27:33Z","pushed_at":"2016-06-05T13:07:19Z","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":20619,"stargazers_count":1419,"watchers_count":1419,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":299,"mirror_url":null,"open_issues_count":154,"forks":299,"open_issues":154,"watchers":1419,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1172"},"html":{"href":"https://github.com/pfnet/chainer/pull/1172"},"issue":{"href":"https://api.github.com/repos/pfnet/chainer/issues/1172"},"comments":{"href":"https://api.github.com/repos/pfnet/chainer/issues/1172/comments"},"review_comments":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1172/comments"},"review_comment":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1172/commits"},"statuses":{"href":"https://api.github.com/repos/pfnet/chainer/statuses/6eeebaf7dd52b7b721cbe8a4ecb9a8acf34df278"}}}}
{"actor":{"display_login":"okuta"}}