{"action":"created","issue":{"url":"https://api.github.com/repos/BVLC/caffe/issues/3025","labels_url":"https://api.github.com/repos/BVLC/caffe/issues/3025/labels{/name}","comments_url":"https://api.github.com/repos/BVLC/caffe/issues/3025/comments","events_url":"https://api.github.com/repos/BVLC/caffe/issues/3025/events","html_url":"https://github.com/BVLC/caffe/pull/3025","id":104804852,"number":3025,"title":"FlattenLayer fix(?) -- top should always Share with bottom","user":{"login":"jeffdonahue","id":965190,"avatar_url":"https://avatars.githubusercontent.com/u/965190?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffdonahue","html_url":"https://github.com/jeffdonahue","followers_url":"https://api.github.com/users/jeffdonahue/followers","following_url":"https://api.github.com/users/jeffdonahue/following{/other_user}","gists_url":"https://api.github.com/users/jeffdonahue/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffdonahue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffdonahue/subscriptions","organizations_url":"https://api.github.com/users/jeffdonahue/orgs","repos_url":"https://api.github.com/users/jeffdonahue/repos","events_url":"https://api.github.com/users/jeffdonahue/events{/privacy}","received_events_url":"https://api.github.com/users/jeffdonahue/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/BVLC/caffe/labels/ready%20for%20review","name":"ready for review","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-04T00:08:51Z","updated_at":"2015-09-04T01:22:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/BVLC/caffe/pulls/3025","html_url":"https://github.com/BVLC/caffe/pull/3025","diff_url":"https://github.com/BVLC/caffe/pull/3025.diff","patch_url":"https://github.com/BVLC/caffe/pull/3025.patch"},"body":"I pulled this commit from #2033, where it is no longer necessary (the current version doesn't use `FlattenLayer`), but in some previous version of my RNN implementation, this was causing incorrect behavior.  The current implementation does `bottom[0]->ShareDiff(*top[0])`, which means that if `bottom[0]` has its own diff `SyncedMemory`,  it gets deleted, which must have interacted with my sharing of input diffs in weird ways.\r\n\r\nThis changes the behavior to work the same way as `ReshapeLayer`.  It also seems somewhat more natural as the `bottom` blobs really \"belong\" to some other layer (whichever one outputs them as `top`s), whereas a layer's `top`s sort of belong to it, so it seems less dangerous for a layer to delete the underlying `SyncedMemory` of its own `top`s.  However, I don't know of any actual cases where this causes problems in current Caffe, so I'll leave it to others to decide whether this should be merged."},"comment":{"url":"https://api.github.com/repos/BVLC/caffe/issues/comments/137616319","html_url":"https://github.com/BVLC/caffe/pull/3025#issuecomment-137616319","issue_url":"https://api.github.com/repos/BVLC/caffe/issues/3025","id":137616319,"user":{"login":"longjon","id":940817,"avatar_url":"https://avatars.githubusercontent.com/u/940817?v=3","gravatar_id":"","url":"https://api.github.com/users/longjon","html_url":"https://github.com/longjon","followers_url":"https://api.github.com/users/longjon/followers","following_url":"https://api.github.com/users/longjon/following{/other_user}","gists_url":"https://api.github.com/users/longjon/gists{/gist_id}","starred_url":"https://api.github.com/users/longjon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/longjon/subscriptions","organizations_url":"https://api.github.com/users/longjon/orgs","repos_url":"https://api.github.com/users/longjon/repos","events_url":"https://api.github.com/users/longjon/events{/privacy}","received_events_url":"https://api.github.com/users/longjon/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T01:22:21Z","updated_at":"2015-09-04T01:22:21Z","body":"I haven't thought carefully (yet?) about whether the current behavior is okay, but I agree that this patch changes the code to what I would expect."}}