{"action":"created","comment":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/comments/86718508","pull_request_review_id":7361430,"id":86718508,"diff_hunk":"@@ -1011,14 +1012,19 @@ cdef class ndarray:\n         cdef Py_ssize_t i, j, offset, ndim, n_newaxes, n_ellipses, ellipsis\n         cdef Py_ssize_t ellipsis_sizem, s_start, s_stop, s_step, dim, ind\n         cdef vector.vector[Py_ssize_t] shape, strides\n-        if not isinstance(slices, tuple):\n+        if isinstance(slices, ndarray):\n+            pass\n+        elif isinstance(slices, numpy.ndarray):\n+            slices = cupy.asarray(slices)\n+        elif not isinstance(slices, tuple):\n             slices = [slices]\n         else:\n             slices = list(slices)\n \n-        for s in slices:\n-            if isinstance(s, ndarray):\n-                raise ValueError('Advanced indexing is not supported')\n+        # boolean array indexing\n+        if isinstance(slices, ndarray) and slices.dtype == bool:\n+            assert internal.vector_equal(self._shape, slices._shape)\n+            return _boolean_array_indexing(self, slices)","path":"cupy/core/core.pyx","position":28,"original_position":28,"commit_id":"d1014f531da78ea386e886e470d79e10ac463f14","original_commit_id":"d1014f531da78ea386e886e470d79e10ac463f14","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":"As advanced indexing has not been fully supported yet, we still need to raise `ValueError` for unsupported slice types.","created_at":"2016-11-07T06:24:36Z","updated_at":"2016-11-07T06:55:28Z","html_url":"https://github.com/pfnet/chainer/pull/1840#discussion_r86718508","pull_request_url":"https://api.github.com/repos/pfnet/chainer/pulls/1840","_links":{"self":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/comments/86718508"},"html":{"href":"https://github.com/pfnet/chainer/pull/1840#discussion_r86718508"},"pull_request":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1840"}}},"pull_request":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/1840","id":92500640,"html_url":"https://github.com/pfnet/chainer/pull/1840","diff_url":"https://github.com/pfnet/chainer/pull/1840.diff","patch_url":"https://github.com/pfnet/chainer/pull/1840.patch","issue_url":"https://api.github.com/repos/pfnet/chainer/issues/1840","number":1840,"state":"open","locked":false,"title":"Support advanced indexing with boolean array for getitem","user":{"login":"wkentaro","id":4310419,"avatar_url":"https://avatars.githubusercontent.com/u/4310419?v=3","gravatar_id":"","url":"https://api.github.com/users/wkentaro","html_url":"https://github.com/wkentaro","followers_url":"https://api.github.com/users/wkentaro/followers","following_url":"https://api.github.com/users/wkentaro/following{/other_user}","gists_url":"https://api.github.com/users/wkentaro/gists{/gist_id}","starred_url":"https://api.github.com/users/wkentaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkentaro/subscriptions","organizations_url":"https://api.github.com/users/wkentaro/orgs","repos_url":"https://api.github.com/users/wkentaro/repos","events_url":"https://api.github.com/users/wkentaro/events{/privacy}","received_events_url":"https://api.github.com/users/wkentaro/received_events","type":"User","site_admin":false},"body":"Related to https://github.com/pfnet/chainer/issues/487","created_at":"2016-11-06T20:11:06Z","updated_at":"2016-11-07T06:55:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e119ffa90e897dc3c9cbb37656b7095859c884db","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pfnet/chainer/pulls/1840/commits","review_comments_url":"https://api.github.com/repos/pfnet/chainer/pulls/1840/comments","review_comment_url":"https://api.github.com/repos/pfnet/chainer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pfnet/chainer/issues/1840/comments","statuses_url":"https://api.github.com/repos/pfnet/chainer/statuses/d1014f531da78ea386e886e470d79e10ac463f14","head":{"label":"wkentaro:getitem-boolean-array","ref":"getitem-boolean-array","sha":"d1014f531da78ea386e886e470d79e10ac463f14","user":{"login":"wkentaro","id":4310419,"avatar_url":"https://avatars.githubusercontent.com/u/4310419?v=3","gravatar_id":"","url":"https://api.github.com/users/wkentaro","html_url":"https://github.com/wkentaro","followers_url":"https://api.github.com/users/wkentaro/followers","following_url":"https://api.github.com/users/wkentaro/following{/other_user}","gists_url":"https://api.github.com/users/wkentaro/gists{/gist_id}","starred_url":"https://api.github.com/users/wkentaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkentaro/subscriptions","organizations_url":"https://api.github.com/users/wkentaro/orgs","repos_url":"https://api.github.com/users/wkentaro/repos","events_url":"https://api.github.com/users/wkentaro/events{/privacy}","received_events_url":"https://api.github.com/users/wkentaro/received_events","type":"User","site_admin":false},"repo":{"id":45491173,"name":"chainer","full_name":"wkentaro/chainer","owner":{"login":"wkentaro","id":4310419,"avatar_url":"https://avatars.githubusercontent.com/u/4310419?v=3","gravatar_id":"","url":"https://api.github.com/users/wkentaro","html_url":"https://github.com/wkentaro","followers_url":"https://api.github.com/users/wkentaro/followers","following_url":"https://api.github.com/users/wkentaro/following{/other_user}","gists_url":"https://api.github.com/users/wkentaro/gists{/gist_id}","starred_url":"https://api.github.com/users/wkentaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkentaro/subscriptions","organizations_url":"https://api.github.com/users/wkentaro/orgs","repos_url":"https://api.github.com/users/wkentaro/repos","events_url":"https://api.github.com/users/wkentaro/events{/privacy}","received_events_url":"https://api.github.com/users/wkentaro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wkentaro/chainer","description":"A flexible framework of neural networks for deep learning","fork":true,"url":"https://api.github.com/repos/wkentaro/chainer","forks_url":"https://api.github.com/repos/wkentaro/chainer/forks","keys_url":"https://api.github.com/repos/wkentaro/chainer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wkentaro/chainer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wkentaro/chainer/teams","hooks_url":"https://api.github.com/repos/wkentaro/chainer/hooks","issue_events_url":"https://api.github.com/repos/wkentaro/chainer/issues/events{/number}","events_url":"https://api.github.com/repos/wkentaro/chainer/events","assignees_url":"https://api.github.com/repos/wkentaro/chainer/assignees{/user}","branches_url":"https://api.github.com/repos/wkentaro/chainer/branches{/branch}","tags_url":"https://api.github.com/repos/wkentaro/chainer/tags","blobs_url":"https://api.github.com/repos/wkentaro/chainer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wkentaro/chainer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wkentaro/chainer/git/refs{/sha}","trees_url":"https://api.github.com/repos/wkentaro/chainer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wkentaro/chainer/statuses/{sha}","languages_url":"https://api.github.com/repos/wkentaro/chainer/languages","stargazers_url":"https://api.github.com/repos/wkentaro/chainer/stargazers","contributors_url":"https://api.github.com/repos/wkentaro/chainer/contributors","subscribers_url":"https://api.github.com/repos/wkentaro/chainer/subscribers","subscription_url":"https://api.github.com/repos/wkentaro/chainer/subscription","commits_url":"https://api.github.com/repos/wkentaro/chainer/commits{/sha}","git_commits_url":"https://api.github.com/repos/wkentaro/chainer/git/commits{/sha}","comments_url":"https://api.github.com/repos/wkentaro/chainer/comments{/number}","issue_comment_url":"https://api.github.com/repos/wkentaro/chainer/issues/comments{/number}","contents_url":"https://api.github.com/repos/wkentaro/chainer/contents/{+path}","compare_url":"https://api.github.com/repos/wkentaro/chainer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wkentaro/chainer/merges","archive_url":"https://api.github.com/repos/wkentaro/chainer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wkentaro/chainer/downloads","issues_url":"https://api.github.com/repos/wkentaro/chainer/issues{/number}","pulls_url":"https://api.github.com/repos/wkentaro/chainer/pulls{/number}","milestones_url":"https://api.github.com/repos/wkentaro/chainer/milestones{/number}","notifications_url":"https://api.github.com/repos/wkentaro/chainer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wkentaro/chainer/labels{/name}","releases_url":"https://api.github.com/repos/wkentaro/chainer/releases{/id}","deployments_url":"https://api.github.com/repos/wkentaro/chainer/deployments","created_at":"2015-11-03T19:43:33Z","updated_at":"2016-10-30T07:50:57Z","pushed_at":"2016-11-06T20:20:21Z","git_url":"git://github.com/wkentaro/chainer.git","ssh_url":"git@github.com:wkentaro/chainer.git","clone_url":"https://github.com/wkentaro/chainer.git","svn_url":"https://github.com/wkentaro/chainer","homepage":"http://chainer.org","size":8473,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"pfnet:master","ref":"master","sha":"d87686f8048a00d25bb3b3a7a5d2b47304d134ff","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-11-07T01:59:43Z","pushed_at":"2016-11-07T06:53:15Z","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":33153,"stargazers_count":1753,"watchers_count":1753,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":448,"mirror_url":null,"open_issues_count":240,"forks":448,"open_issues":240,"watchers":1753,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1840"},"html":{"href":"https://github.com/pfnet/chainer/pull/1840"},"issue":{"href":"https://api.github.com/repos/pfnet/chainer/issues/1840"},"comments":{"href":"https://api.github.com/repos/pfnet/chainer/issues/1840/comments"},"review_comments":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1840/comments"},"review_comment":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pfnet/chainer/pulls/1840/commits"},"statuses":{"href":"https://api.github.com/repos/pfnet/chainer/statuses/d1014f531da78ea386e886e470d79e10ac463f14"}}}}
{"actor":{"display_login":"delta2323"}}