{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/129234857","pull_request_review_id":51985023,"id":129234857,"diff_hunk":"@@ -1,8 +1,15 @@\n import ctypes\n import os\n \n-path = os.path.join(os.path.dirname(__file__), \"libpaddle_master.so\")\n-lib = ctypes.cdll.LoadLibrary(path)\n+__lib__ = None\n+\n+\n+def get_c_lib():\n+    if __lib__ is None:\n+        global __lib__","path":"python/paddle/v2/master/client.py","position":null,"original_position":11,"commit_id":"61cd828f3a8d2c37caf801825e96867c9068caf8","original_commit_id":"385bd4648ea90a573a4344a9557e55f2f98e022e","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":"Done.","created_at":"2017-07-25T07:54:02Z","updated_at":"2017-07-25T07:54:02Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/3045#discussion_r129234857","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/3045","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/129234857"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/3045#discussion_r129234857"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/3045"}}},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/3045","id":132205795,"html_url":"https://github.com/PaddlePaddle/Paddle/pull/3045","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/3045.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/3045.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/3045","number":3045,"state":"open","locked":false,"title":"Make C lib in `paddle.v2.master.client` lazy load","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":"Currently, WITH_GOLANG is a compiling flag, and not all Paddle binary\r\nenable `WITH_GOLANG=ON`. So we cannot ensure that every paddle has\r\n`master.so`. Make load that C libary lazily could let the user run\r\nPaddle without `WITH_GOLANG=ON`.","created_at":"2017-07-25T06:34:28Z","updated_at":"2017-07-25T07:54:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ff9fcdafd0f585c1c241b18395ffe5674c34527","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/3045/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/3045/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/3045/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/61cd828f3a8d2c37caf801825e96867c9068caf8","head":{"label":"reyoung:feature/make_golang_client_lazy_load","ref":"feature/make_golang_client_lazy_load","sha":"61cd828f3a8d2c37caf801825e96867c9068caf8","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},"repo":{"id":67185903,"name":"Paddle","full_name":"reyoung/Paddle","owner":{"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},"private":false,"html_url":"https://github.com/reyoung/Paddle","description":"PArallel Distributed Deep LEarning","fork":true,"url":"https://api.github.com/repos/reyoung/Paddle","forks_url":"https://api.github.com/repos/reyoung/Paddle/forks","keys_url":"https://api.github.com/repos/reyoung/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reyoung/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reyoung/Paddle/teams","hooks_url":"https://api.github.com/repos/reyoung/Paddle/hooks","issue_events_url":"https://api.github.com/repos/reyoung/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/reyoung/Paddle/events","assignees_url":"https://api.github.com/repos/reyoung/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/reyoung/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/reyoung/Paddle/tags","blobs_url":"https://api.github.com/repos/reyoung/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reyoung/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reyoung/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/reyoung/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reyoung/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/reyoung/Paddle/languages","stargazers_url":"https://api.github.com/repos/reyoung/Paddle/stargazers","contributors_url":"https://api.github.com/repos/reyoung/Paddle/contributors","subscribers_url":"https://api.github.com/repos/reyoung/Paddle/subscribers","subscription_url":"https://api.github.com/repos/reyoung/Paddle/subscription","commits_url":"https://api.github.com/repos/reyoung/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/reyoung/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/reyoung/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/reyoung/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/reyoung/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/reyoung/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reyoung/Paddle/merges","archive_url":"https://api.github.com/repos/reyoung/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reyoung/Paddle/downloads","issues_url":"https://api.github.com/repos/reyoung/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/reyoung/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/reyoung/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/reyoung/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reyoung/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/reyoung/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/reyoung/Paddle/deployments","created_at":"2016-09-02T03:14:43Z","updated_at":"2017-04-17T08:16:04Z","pushed_at":"2017-07-25T07:52:57Z","git_url":"git://github.com/reyoung/Paddle.git","ssh_url":"git@github.com:reyoung/Paddle.git","clone_url":"https://github.com/reyoung/Paddle.git","svn_url":"https://github.com/reyoung/Paddle","homepage":"http://www.paddlepaddle.org/","size":28942,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"0c2790f7e5583c3f57e451fee0acd395e4f2a379","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-07-25T04:39:40Z","pushed_at":"2017-07-25T07:52:59Z","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":42478,"stargazers_count":5209,"watchers_count":5209,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1381,"mirror_url":null,"open_issues_count":545,"forks":1381,"open_issues":545,"watchers":5209,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/3045"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/3045"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/3045"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/3045/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/3045/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/3045/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/61cd828f3a8d2c37caf801825e96867c9068caf8"}}}}
{"actor":{"display_login":"reyoung"}}