{"action":"created","issue":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/6037","repository_url":"https://api.github.com/repos/PaddlePaddle/Paddle","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/6037/labels{/name}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/6037/comments","events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/6037/events","html_url":"https://github.com/PaddlePaddle/Paddle/issues/6037","id":277680400,"number":6037,"title":"`Executor` should not create variable whose name are `@Empty@`","user":{"login":"Canpio","id":8395645,"avatar_url":"https://avatars2.githubusercontent.com/u/8395645?v=4","gravatar_id":"","url":"https://api.github.com/users/Canpio","html_url":"https://github.com/Canpio","followers_url":"https://api.github.com/users/Canpio/followers","following_url":"https://api.github.com/users/Canpio/following{/other_user}","gists_url":"https://api.github.com/users/Canpio/gists{/gist_id}","starred_url":"https://api.github.com/users/Canpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Canpio/subscriptions","organizations_url":"https://api.github.com/users/Canpio/orgs","repos_url":"https://api.github.com/users/Canpio/repos","events_url":"https://api.github.com/users/Canpio/events{/privacy}","received_events_url":"https://api.github.com/users/Canpio/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"Canpio","id":8395645,"avatar_url":"https://avatars2.githubusercontent.com/u/8395645?v=4","gravatar_id":"","url":"https://api.github.com/users/Canpio","html_url":"https://github.com/Canpio","followers_url":"https://api.github.com/users/Canpio/followers","following_url":"https://api.github.com/users/Canpio/following{/other_user}","gists_url":"https://api.github.com/users/Canpio/gists{/gist_id}","starred_url":"https://api.github.com/users/Canpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Canpio/subscriptions","organizations_url":"https://api.github.com/users/Canpio/orgs","repos_url":"https://api.github.com/users/Canpio/repos","events_url":"https://api.github.com/users/Canpio/events{/privacy}","received_events_url":"https://api.github.com/users/Canpio/received_events","type":"User","site_admin":false},"assignees":[{"login":"Canpio","id":8395645,"avatar_url":"https://avatars2.githubusercontent.com/u/8395645?v=4","gravatar_id":"","url":"https://api.github.com/users/Canpio","html_url":"https://github.com/Canpio","followers_url":"https://api.github.com/users/Canpio/followers","following_url":"https://api.github.com/users/Canpio/following{/other_user}","gists_url":"https://api.github.com/users/Canpio/gists{/gist_id}","starred_url":"https://api.github.com/users/Canpio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Canpio/subscriptions","organizations_url":"https://api.github.com/users/Canpio/orgs","repos_url":"https://api.github.com/users/Canpio/repos","events_url":"https://api.github.com/users/Canpio/events{/privacy}","received_events_url":"https://api.github.com/users/Canpio/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/milestones/6","html_url":"https://github.com/PaddlePaddle/Paddle/milestone/6","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/milestones/6/labels","id":2932667,"number":6,"title":"Release 0.11.0","description":"","creator":{"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},"open_issues":6,"closed_issues":43,"state":"open","created_at":"2017-11-23T06:33:30Z","updated_at":"2017-12-06T04:44:24Z","due_on":"2017-12-08T08:00:00Z","closed_at":null},"comments":0,"created_at":"2017-11-29T09:18:41Z","updated_at":"2017-12-06T04:44:24Z","closed_at":"2017-12-06T04:44:23Z","author_association":"CONTRIBUTOR","body":"In backward building process, `@Empty@` is used to rename variables to indicate that they are not necessary for backward. If we try accessing a `@Empty@`, we shall get a `nullptr`. This is required by several places in our code, for example:\r\n```cpp\r\nclass WhileGradOpVarTypeInference : public framework::VarTypeInference {\r\n public:\r\n  void operator()(const framework::OpDescBind &op_desc,\r\n                  framework::BlockDescBind *block) const override {\r\n    auto p_names = op_desc.Input(kParameters);\r\n    auto pg_names = op_desc.Output(framework::GradVarName(kParameters));\r\n\r\n    for (size_t i = 0; i < p_names.size(); ++i) {\r\n      auto &p_var = detail::Ref(block->FindVarRecursive(p_names[i]));\r\n      auto *g_var = block->FindVarRecursive(pg_names[i]);\r\n      if (g_var != nullptr) {  // Gradient could be @EMPTY@\r\n        VLOG(5) << \"Setting \" << pg_names[i] << \" following \" << p_names[i]\r\n                << \" type: \" << p_var.GetType();\r\n        g_var->SetType(p_var.GetType());\r\n        g_var->SetDataType(p_var.GetDataType());\r\n      }\r\n    }\r\n  }\r\n};\r\n```\r\nif `g_var` is not `nullptr` while `pg_names[i]` is `@Empty@`, we wil go into the `if` block and then invoke `g_var->SetDataType(p_var.GetDataType());`. However, as a variable which has no gradient value, `p_var`maight be some special type which is not supported by `GetDataType()` (e.g.  `lod_rank_table`).\r\n\r\nTo aviod it, we shall make sure that `Executor` does not create variables whose name are `@Empty@`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/comments/349531934","html_url":"https://github.com/PaddlePaddle/Paddle/issues/6037#issuecomment-349531934","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/6037","id":349531934,"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},"created_at":"2017-12-06T04:44:23Z","updated_at":"2017-12-06T04:44:23Z","author_association":"CONTRIBUTOR","body":"Done"}}
{"actor":{"display_login":"reyoung"}}