{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/138410906","pull_request_review_id":62202233,"id":138410906,"diff_hunk":"@@ -53,17 +53,23 @@ bool operator==(const LoD& a, const LoD& b);\n  */\n class LoDTensor {\n  public:\n-  LoDTensor() {}\n-  LoDTensor(const LoD& lod, Tensor* t) : lod_(lod), tensor_(t) {}\n+  LoDTensor() : tensor_(new Tensor()) {}\n \n-  void set_lod(const LoD& lod) { lod_ = lod; }\n+  LoDTensor(const LoD& lod) : lod_(lod), tensor_(new Tensor()) {}\n \n-  void set_tensor(Tensor* tensor) { tensor_ = tensor; }\n+  ~LoDTensor() { delete tensor_; }","path":"paddle/framework/lod_tensor.h","position":12,"original_position":12,"commit_id":"c60a027e18b150ede7b91e8ca30a508617c4843b","original_commit_id":"c60a027e18b150ede7b91e8ca30a508617c4843b","user":{"login":"reyoung","id":728699,"avatar_url":"https://avatars2.githubusercontent.com/u/728699?v=4","gravatar_id":"","url":"https://api.github.com/users/reyoung","html_url":"https://github.com/reyoung","followers_url":"https://api.github.com/users/reyoung/followers","following_url":"https://api.github.com/users/reyoung/following{/other_user}","gists_url":"https://api.github.com/users/reyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/reyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reyoung/subscriptions","organizations_url":"https://api.github.com/users/reyoung/orgs","repos_url":"https://api.github.com/users/reyoung/repos","events_url":"https://api.github.com/users/reyoung/events{/privacy}","received_events_url":"https://api.github.com/users/reyoung/received_events","type":"User","site_admin":false},"body":"maybe LoDTensor should\r\n\r\n* Disable copy\r\n* Disable assign\r\n* Disable move\r\n\r\nThe simplest way to implement it is make `tensor_` as `unique_ptr`","created_at":"2017-09-12T17:10:13Z","updated_at":"2017-09-12T17:10:13Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/4048#discussion_r138410906","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/4048","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/138410906"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/4048#discussion_r138410906"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/4048"}},"in_reply_to_id":138353958},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/4048","id":140583774,"html_url":"https://github.com/PaddlePaddle/Paddle/pull/4048","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/4048.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/4048.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/4048","number":4048,"state":"open","locked":false,"title":"[WIP] Using LoDTensor instead of Tensor in every operator.","user":{"login":"qingqing01","id":7845005,"avatar_url":"https://avatars0.githubusercontent.com/u/7845005?v=4","gravatar_id":"","url":"https://api.github.com/users/qingqing01","html_url":"https://github.com/qingqing01","followers_url":"https://api.github.com/users/qingqing01/followers","following_url":"https://api.github.com/users/qingqing01/following{/other_user}","gists_url":"https://api.github.com/users/qingqing01/gists{/gist_id}","starred_url":"https://api.github.com/users/qingqing01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qingqing01/subscriptions","organizations_url":"https://api.github.com/users/qingqing01/orgs","repos_url":"https://api.github.com/users/qingqing01/repos","events_url":"https://api.github.com/users/qingqing01/events{/privacy}","received_events_url":"https://api.github.com/users/qingqing01/received_events","type":"User","site_admin":false},"body":"Fix https://github.com/PaddlePaddle/Paddle/issues/4047\r\nFix https://github.com/PaddlePaddle/Paddle/issues/3717\r\n\r\n解决的问题：\r\n\r\n- LoDTensor管理成员变量`Tensor* tensor_`的构造和释放\r\n  - 详细描述： https://github.com/PaddlePaddle/Paddle/issues/4047#issue-257042405\r\n- 如何在不感知LoD的operators用LoDTensor替换Tensor\r\n  - 详细描述： https://github.com/PaddlePaddle/Paddle/issues/4047#issuecomment-328853066\r\n- 如何传递LoD\r\n  -  详细描述：https://github.com/PaddlePaddle/Paddle/issues/4047#issuecomment-328853467\r\n\r\n\r\n@wangkuiyi @reyoung @Superjom @QiJune @hedaoyuan \r\n\r\n- 这里只写了示例程序，还没有全局替换。\r\n- 和大家讨论下，这种方式是否可以。\r\n- 如果可行，再全局替换。","created_at":"2017-09-12T13:45:27Z","updated_at":"2017-09-12T17:10:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dedb9b629ecc5efc2d641b0e31e92b9429d7ea0d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Superjom","id":328693,"avatar_url":"https://avatars1.githubusercontent.com/u/328693?v=4","gravatar_id":"","url":"https://api.github.com/users/Superjom","html_url":"https://github.com/Superjom","followers_url":"https://api.github.com/users/Superjom/followers","following_url":"https://api.github.com/users/Superjom/following{/other_user}","gists_url":"https://api.github.com/users/Superjom/gists{/gist_id}","starred_url":"https://api.github.com/users/Superjom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Superjom/subscriptions","organizations_url":"https://api.github.com/users/Superjom/orgs","repos_url":"https://api.github.com/users/Superjom/repos","events_url":"https://api.github.com/users/Superjom/events{/privacy}","received_events_url":"https://api.github.com/users/Superjom/received_events","type":"User","site_admin":false},{"login":"reyoung","id":728699,"avatar_url":"https://avatars2.githubusercontent.com/u/728699?v=4","gravatar_id":"","url":"https://api.github.com/users/reyoung","html_url":"https://github.com/reyoung","followers_url":"https://api.github.com/users/reyoung/followers","following_url":"https://api.github.com/users/reyoung/following{/other_user}","gists_url":"https://api.github.com/users/reyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/reyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reyoung/subscriptions","organizations_url":"https://api.github.com/users/reyoung/orgs","repos_url":"https://api.github.com/users/reyoung/repos","events_url":"https://api.github.com/users/reyoung/events{/privacy}","received_events_url":"https://api.github.com/users/reyoung/received_events","type":"User","site_admin":false},{"login":"wangkuiyi","id":1548775,"avatar_url":"https://avatars0.githubusercontent.com/u/1548775?v=4","gravatar_id":"","url":"https://api.github.com/users/wangkuiyi","html_url":"https://github.com/wangkuiyi","followers_url":"https://api.github.com/users/wangkuiyi/followers","following_url":"https://api.github.com/users/wangkuiyi/following{/other_user}","gists_url":"https://api.github.com/users/wangkuiyi/gists{/gist_id}","starred_url":"https://api.github.com/users/wangkuiyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangkuiyi/subscriptions","organizations_url":"https://api.github.com/users/wangkuiyi/orgs","repos_url":"https://api.github.com/users/wangkuiyi/repos","events_url":"https://api.github.com/users/wangkuiyi/events{/privacy}","received_events_url":"https://api.github.com/users/wangkuiyi/received_events","type":"User","site_admin":false},{"login":"hedaoyuan","id":21339431,"avatar_url":"https://avatars3.githubusercontent.com/u/21339431?v=4","gravatar_id":"","url":"https://api.github.com/users/hedaoyuan","html_url":"https://github.com/hedaoyuan","followers_url":"https://api.github.com/users/hedaoyuan/followers","following_url":"https://api.github.com/users/hedaoyuan/following{/other_user}","gists_url":"https://api.github.com/users/hedaoyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/hedaoyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hedaoyuan/subscriptions","organizations_url":"https://api.github.com/users/hedaoyuan/orgs","repos_url":"https://api.github.com/users/hedaoyuan/repos","events_url":"https://api.github.com/users/hedaoyuan/events{/privacy}","received_events_url":"https://api.github.com/users/hedaoyuan/received_events","type":"User","site_admin":false},{"login":"QiJune","id":22017000,"avatar_url":"https://avatars0.githubusercontent.com/u/22017000?v=4","gravatar_id":"","url":"https://api.github.com/users/QiJune","html_url":"https://github.com/QiJune","followers_url":"https://api.github.com/users/QiJune/followers","following_url":"https://api.github.com/users/QiJune/following{/other_user}","gists_url":"https://api.github.com/users/QiJune/gists{/gist_id}","starred_url":"https://api.github.com/users/QiJune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QiJune/subscriptions","organizations_url":"https://api.github.com/users/QiJune/orgs","repos_url":"https://api.github.com/users/QiJune/repos","events_url":"https://api.github.com/users/QiJune/events{/privacy}","received_events_url":"https://api.github.com/users/QiJune/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/4048/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/4048/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/4048/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/c60a027e18b150ede7b91e8ca30a508617c4843b","head":{"label":"qingqing01:lod_tensor","ref":"lod_tensor","sha":"c60a027e18b150ede7b91e8ca30a508617c4843b","user":{"login":"qingqing01","id":7845005,"avatar_url":"https://avatars0.githubusercontent.com/u/7845005?v=4","gravatar_id":"","url":"https://api.github.com/users/qingqing01","html_url":"https://github.com/qingqing01","followers_url":"https://api.github.com/users/qingqing01/followers","following_url":"https://api.github.com/users/qingqing01/following{/other_user}","gists_url":"https://api.github.com/users/qingqing01/gists{/gist_id}","starred_url":"https://api.github.com/users/qingqing01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qingqing01/subscriptions","organizations_url":"https://api.github.com/users/qingqing01/orgs","repos_url":"https://api.github.com/users/qingqing01/repos","events_url":"https://api.github.com/users/qingqing01/events{/privacy}","received_events_url":"https://api.github.com/users/qingqing01/received_events","type":"User","site_admin":false},"repo":{"id":66909112,"name":"Paddle","full_name":"qingqing01/Paddle","owner":{"login":"qingqing01","id":7845005,"avatar_url":"https://avatars0.githubusercontent.com/u/7845005?v=4","gravatar_id":"","url":"https://api.github.com/users/qingqing01","html_url":"https://github.com/qingqing01","followers_url":"https://api.github.com/users/qingqing01/followers","following_url":"https://api.github.com/users/qingqing01/following{/other_user}","gists_url":"https://api.github.com/users/qingqing01/gists{/gist_id}","starred_url":"https://api.github.com/users/qingqing01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qingqing01/subscriptions","organizations_url":"https://api.github.com/users/qingqing01/orgs","repos_url":"https://api.github.com/users/qingqing01/repos","events_url":"https://api.github.com/users/qingqing01/events{/privacy}","received_events_url":"https://api.github.com/users/qingqing01/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qingqing01/Paddle","description":"PArallel Distributed Deep LEarning","fork":true,"url":"https://api.github.com/repos/qingqing01/Paddle","forks_url":"https://api.github.com/repos/qingqing01/Paddle/forks","keys_url":"https://api.github.com/repos/qingqing01/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qingqing01/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qingqing01/Paddle/teams","hooks_url":"https://api.github.com/repos/qingqing01/Paddle/hooks","issue_events_url":"https://api.github.com/repos/qingqing01/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/qingqing01/Paddle/events","assignees_url":"https://api.github.com/repos/qingqing01/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/qingqing01/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/qingqing01/Paddle/tags","blobs_url":"https://api.github.com/repos/qingqing01/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qingqing01/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qingqing01/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/qingqing01/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qingqing01/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/qingqing01/Paddle/languages","stargazers_url":"https://api.github.com/repos/qingqing01/Paddle/stargazers","contributors_url":"https://api.github.com/repos/qingqing01/Paddle/contributors","subscribers_url":"https://api.github.com/repos/qingqing01/Paddle/subscribers","subscription_url":"https://api.github.com/repos/qingqing01/Paddle/subscription","commits_url":"https://api.github.com/repos/qingqing01/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/qingqing01/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/qingqing01/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/qingqing01/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/qingqing01/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/qingqing01/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qingqing01/Paddle/merges","archive_url":"https://api.github.com/repos/qingqing01/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qingqing01/Paddle/downloads","issues_url":"https://api.github.com/repos/qingqing01/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/qingqing01/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/qingqing01/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/qingqing01/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qingqing01/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/qingqing01/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/qingqing01/Paddle/deployments","created_at":"2016-08-30T05:21:17Z","updated_at":"2016-08-30T05:21:20Z","pushed_at":"2017-09-12T12:38:33Z","git_url":"git://github.com/qingqing01/Paddle.git","ssh_url":"git@github.com:qingqing01/Paddle.git","clone_url":"https://github.com/qingqing01/Paddle.git","svn_url":"https://github.com/qingqing01/Paddle","homepage":null,"size":26300,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"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":"PaddlePaddle:develop","ref":"develop","sha":"bc9f4c55909130fd5d09001d9571b41422910fd8","user":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"repo":{"id":65711522,"name":"Paddle","full_name":"PaddlePaddle/Paddle","owner":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PaddlePaddle/Paddle","description":"PArallel Distributed Deep LEarning","fork":false,"url":"https://api.github.com/repos/PaddlePaddle/Paddle","forks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/forks","keys_url":"https://api.github.com/repos/PaddlePaddle/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaddlePaddle/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaddlePaddle/Paddle/teams","hooks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/hooks","issue_events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/events","assignees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/PaddlePaddle/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/tags","blobs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/PaddlePaddle/Paddle/languages","stargazers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/stargazers","contributors_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contributors","subscribers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscribers","subscription_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscription","commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/PaddlePaddle/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaddlePaddle/Paddle/merges","archive_url":"https://api.github.com/repos/PaddlePaddle/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaddlePaddle/Paddle/downloads","issues_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/PaddlePaddle/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/PaddlePaddle/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/PaddlePaddle/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/deployments","created_at":"2016-08-15T06:59:08Z","updated_at":"2017-09-12T15:02:45Z","pushed_at":"2017-09-12T16:38:47Z","git_url":"git://github.com/PaddlePaddle/Paddle.git","ssh_url":"git@github.com:PaddlePaddle/Paddle.git","clone_url":"https://github.com/PaddlePaddle/Paddle.git","svn_url":"https://github.com/PaddlePaddle/Paddle","homepage":"http://www.paddlepaddle.org/","size":50331,"stargazers_count":5396,"watchers_count":5396,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1441,"mirror_url":null,"open_issues_count":609,"forks":1441,"open_issues":609,"watchers":5396,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/4048"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/4048"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/4048"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/4048/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/4048/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/4048/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/c60a027e18b150ede7b91e8ca30a508617c4843b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"reyoung"}}