{"action":"created","issue":{"url":"https://api.github.com/repos/pfnet/chainer/issues/1919","repository_url":"https://api.github.com/repos/pfnet/chainer","labels_url":"https://api.github.com/repos/pfnet/chainer/issues/1919/labels{/name}","comments_url":"https://api.github.com/repos/pfnet/chainer/issues/1919/comments","events_url":"https://api.github.com/repos/pfnet/chainer/issues/1919/events","html_url":"https://github.com/pfnet/chainer/pull/1919","id":191659965,"number":1919,"title":"Add scatter_update","user":{"login":"yuyu2172","id":2062128,"avatar_url":"https://avatars.githubusercontent.com/u/2062128?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyu2172","html_url":"https://github.com/yuyu2172","followers_url":"https://api.github.com/users/yuyu2172/followers","following_url":"https://api.github.com/users/yuyu2172/following{/other_user}","gists_url":"https://api.github.com/users/yuyu2172/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyu2172/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyu2172/subscriptions","organizations_url":"https://api.github.com/users/yuyu2172/orgs","repos_url":"https://api.github.com/users/yuyu2172/repos","events_url":"https://api.github.com/users/yuyu2172/events{/privacy}","received_events_url":"https://api.github.com/users/yuyu2172/received_events","type":"User","site_admin":false},"labels":[{"id":485600368,"url":"https://api.github.com/repos/pfnet/chainer/labels/CuPy","name":"CuPy","color":"006b75","default":false},{"id":222603817,"url":"https://api.github.com/repos/pfnet/chainer/labels/feature","name":"feature","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"rezoo","id":212315,"avatar_url":"https://avatars.githubusercontent.com/u/212315?v=3","gravatar_id":"","url":"https://api.github.com/users/rezoo","html_url":"https://github.com/rezoo","followers_url":"https://api.github.com/users/rezoo/followers","following_url":"https://api.github.com/users/rezoo/following{/other_user}","gists_url":"https://api.github.com/users/rezoo/gists{/gist_id}","starred_url":"https://api.github.com/users/rezoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rezoo/subscriptions","organizations_url":"https://api.github.com/users/rezoo/orgs","repos_url":"https://api.github.com/users/rezoo/repos","events_url":"https://api.github.com/users/rezoo/events{/privacy}","received_events_url":"https://api.github.com/users/rezoo/received_events","type":"User","site_admin":false},"assignees":[{"login":"rezoo","id":212315,"avatar_url":"https://avatars.githubusercontent.com/u/212315?v=3","gravatar_id":"","url":"https://api.github.com/users/rezoo","html_url":"https://github.com/rezoo","followers_url":"https://api.github.com/users/rezoo/followers","following_url":"https://api.github.com/users/rezoo/following{/other_user}","gists_url":"https://api.github.com/users/rezoo/gists{/gist_id}","starred_url":"https://api.github.com/users/rezoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rezoo/subscriptions","organizations_url":"https://api.github.com/users/rezoo/orgs","repos_url":"https://api.github.com/users/rezoo/repos","events_url":"https://api.github.com/users/rezoo/events{/privacy}","received_events_url":"https://api.github.com/users/rezoo/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-11-25T09:36:56Z","updated_at":"2016-12-16T05:53:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pfnet/chainer/pulls/1919","html_url":"https://github.com/pfnet/chainer/pull/1919","diff_url":"https://github.com/pfnet/chainer/pull/1919.diff","patch_url":"https://github.com/pfnet/chainer/pull/1919.patch"},"body":"This PR is related to #1844 that I closed.\r\n\r\nThe PR adds CuPy a new function `scatter_update`.\r\nThere is no compatible \"function\" in NumPy. However, you can think of it as `__setitem__` with one integer array in the slices argument (i.e. `x.scatter_update(idx, val, axis=1)` behaves like `x[:, idx] = val`).\r\n\r\nThere are two differences from NumPy's `__setitem__`.\r\n\r\n+ `scatter_update` does not raise error when indices exceed size of axes. Instead, `scatter_update` wraps indices.\r\n+ as stated in #1844, when indices with duplicate values are input, the behavior is undefined.\r\n\r\n\r\nI prefer to name this function `scatter_update` instead of `put` as I originally did in #1844 because of the following two reasons.\r\n\r\n+ `put` repeats `value` when it is shorter than `ind`. I am not planning to support that behavior.\r\n+ This name is more consistent with `scatter_add` (#1920).\r\n\r\n\r\nNote that the implementation is general (e.g. `_scatter_op` instead of more specific `_scatter_update`), because it makes more sense when adding `scatter_add` (#1920)."},"comment":{"url":"https://api.github.com/repos/pfnet/chainer/issues/comments/267522800","html_url":"https://github.com/pfnet/chainer/pull/1919#issuecomment-267522800","issue_url":"https://api.github.com/repos/pfnet/chainer/issues/1919","id":267522800,"user":{"login":"rezoo","id":212315,"avatar_url":"https://avatars.githubusercontent.com/u/212315?v=3","gravatar_id":"","url":"https://api.github.com/users/rezoo","html_url":"https://github.com/rezoo","followers_url":"https://api.github.com/users/rezoo/followers","following_url":"https://api.github.com/users/rezoo/following{/other_user}","gists_url":"https://api.github.com/users/rezoo/gists{/gist_id}","starred_url":"https://api.github.com/users/rezoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rezoo/subscriptions","organizations_url":"https://api.github.com/users/rezoo/orgs","repos_url":"https://api.github.com/users/rezoo/repos","events_url":"https://api.github.com/users/rezoo/events{/privacy}","received_events_url":"https://api.github.com/users/rezoo/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T05:53:47Z","updated_at":"2016-12-16T05:53:47Z","body":"Good. In order to induce people who want to use a ``put`` function on GPU, could you add a section of ``put`` to the reference, and explains that we provide an alternative function called ``scatter_update`` although its specification is a little bit different?"}}
{"actor":{"display_login":"rezoo"}}