{"action":"created","comment":{"url":"https://api.github.com/repos/Theano/Theano/pulls/comments/67722221","id":67722221,"diff_hunk":"@@ -215,6 +256,242 @@ def apply(self, fgraph):\n                     0, 'fast_run', 'fast_compile', 'merge')\n \n \n+class GraphToGPU(NavigatorOptimizer):\n+    \"\"\"\n+    Transfer the graph as a whole to GPU instead of transfering node by node.\n+    \"\"\"\n+\n+    def __init__(self, local_optimizers_all, local_optimizers_map):\n+        self.local_optimizers_all = local_optimizers_all\n+        self.local_optimizers_map = local_optimizers_map\n+        self.failure_callback = None\n+\n+    def add_requirements(self, fgraph):\n+        fgraph.attach_feature(toolbox.ReplaceValidate())\n+\n+    def apply(self, fgraph):\n+        mapping = {}\n+        time_opts = {}\n+        node_created = {}\n+        process_count = {}\n+        t_topo = time.time()\n+        topo = fgraph.toposort()\n+        time_topo = time.time()\n+        toposort_timing = time_topo - t_topo\n+\n+        # Building a new graph\n+        # Iterating through inputs of graph\n+        target = infer_context_name(*fgraph.inputs)\n+        for i in fgraph.inputs:\n+            # Do not move *int* scalar to the GPU.\n+            target = getattr(i.tag, 'target', None)\n+            if (target != 'cpu' and\n+               isinstance(i.type, tensor.TensorType) and\n+               (i.ndim > 0 or 'int' not in i.dtype)):\n+                mapping[i] = as_gpuarray_variable(i, target)","path":"theano/gpuarray/opt.py","position":169,"original_position":169,"commit_id":"1736a6ce4ae50c6b3a6b4c286e1f23b8a43a0f33","original_commit_id":"1736a6ce4ae50c6b3a6b4c286e1f23b8a43a0f33","user":{"login":"Sentient07","id":6195312,"avatar_url":"https://avatars.githubusercontent.com/u/6195312?v=3","gravatar_id":"","url":"https://api.github.com/users/Sentient07","html_url":"https://github.com/Sentient07","followers_url":"https://api.github.com/users/Sentient07/followers","following_url":"https://api.github.com/users/Sentient07/following{/other_user}","gists_url":"https://api.github.com/users/Sentient07/gists{/gist_id}","starred_url":"https://api.github.com/users/Sentient07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sentient07/subscriptions","organizations_url":"https://api.github.com/users/Sentient07/orgs","repos_url":"https://api.github.com/users/Sentient07/repos","events_url":"https://api.github.com/users/Sentient07/events{/privacy}","received_events_url":"https://api.github.com/users/Sentient07/received_events","type":"User","site_admin":false},"body":"What is the difference in getting the context_name by calling `infer_context_name`(line : 284) and `get_context` ?","created_at":"2016-06-20T16:37:37Z","updated_at":"2016-06-20T16:37:37Z","html_url":"https://github.com/Theano/Theano/pull/4570#discussion_r67722221","pull_request_url":"https://api.github.com/repos/Theano/Theano/pulls/4570","_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments/67722221"},"html":{"href":"https://github.com/Theano/Theano/pull/4570#discussion_r67722221"},"pull_request":{"href":"https://api.github.com/repos/Theano/Theano/pulls/4570"}}},"pull_request":{"url":"https://api.github.com/repos/Theano/Theano/pulls/4570","id":72236658,"html_url":"https://github.com/Theano/Theano/pull/4570","diff_url":"https://github.com/Theano/Theano/pull/4570.diff","patch_url":"https://github.com/Theano/Theano/pull/4570.patch","issue_url":"https://api.github.com/repos/Theano/Theano/issues/4570","number":4570,"state":"open","locked":false,"title":"New graph2gpu","user":{"login":"Sentient07","id":6195312,"avatar_url":"https://avatars.githubusercontent.com/u/6195312?v=3","gravatar_id":"","url":"https://api.github.com/users/Sentient07","html_url":"https://github.com/Sentient07","followers_url":"https://api.github.com/users/Sentient07/followers","following_url":"https://api.github.com/users/Sentient07/following{/other_user}","gists_url":"https://api.github.com/users/Sentient07/gists{/gist_id}","starred_url":"https://api.github.com/users/Sentient07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sentient07/subscriptions","organizations_url":"https://api.github.com/users/Sentient07/orgs","repos_url":"https://api.github.com/users/Sentient07/repos","events_url":"https://api.github.com/users/Sentient07/events{/privacy}","received_events_url":"https://api.github.com/users/Sentient07/received_events","type":"User","site_admin":false},"body":"The continuation of https://github.com/Theano/Theano/pull/4551 after a pathetic rebase. \r\n\r\nTODO : \r\n\r\n- [ ]  Make Travis and the local tests on GPU pass\r\n\r\n- [x] Add the missed out opt to register_opt2\r\n\r\n- [ ] Cache GpuCAReduceCuda, GpuElemwise and others(if possible)\r\n\r\n- [x] Profile with Line_profiler \r\n\r\n- [ ] Documentation ","created_at":"2016-06-01T19:18:54Z","updated_at":"2016-06-20T16:37:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5b720d5a9000e65741162babdbc4aa98023cb27","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Theano/Theano/pulls/4570/commits","review_comments_url":"https://api.github.com/repos/Theano/Theano/pulls/4570/comments","review_comment_url":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/4570/comments","statuses_url":"https://api.github.com/repos/Theano/Theano/statuses/1736a6ce4ae50c6b3a6b4c286e1f23b8a43a0f33","head":{"label":"Sentient07:new_graph2gpu","ref":"new_graph2gpu","sha":"1736a6ce4ae50c6b3a6b4c286e1f23b8a43a0f33","user":{"login":"Sentient07","id":6195312,"avatar_url":"https://avatars.githubusercontent.com/u/6195312?v=3","gravatar_id":"","url":"https://api.github.com/users/Sentient07","html_url":"https://github.com/Sentient07","followers_url":"https://api.github.com/users/Sentient07/followers","following_url":"https://api.github.com/users/Sentient07/following{/other_user}","gists_url":"https://api.github.com/users/Sentient07/gists{/gist_id}","starred_url":"https://api.github.com/users/Sentient07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sentient07/subscriptions","organizations_url":"https://api.github.com/users/Sentient07/orgs","repos_url":"https://api.github.com/users/Sentient07/repos","events_url":"https://api.github.com/users/Sentient07/events{/privacy}","received_events_url":"https://api.github.com/users/Sentient07/received_events","type":"User","site_admin":false},"repo":{"id":46736322,"name":"Theano","full_name":"Sentient07/Theano","owner":{"login":"Sentient07","id":6195312,"avatar_url":"https://avatars.githubusercontent.com/u/6195312?v=3","gravatar_id":"","url":"https://api.github.com/users/Sentient07","html_url":"https://github.com/Sentient07","followers_url":"https://api.github.com/users/Sentient07/followers","following_url":"https://api.github.com/users/Sentient07/following{/other_user}","gists_url":"https://api.github.com/users/Sentient07/gists{/gist_id}","starred_url":"https://api.github.com/users/Sentient07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sentient07/subscriptions","organizations_url":"https://api.github.com/users/Sentient07/orgs","repos_url":"https://api.github.com/users/Sentient07/repos","events_url":"https://api.github.com/users/Sentient07/events{/privacy}","received_events_url":"https://api.github.com/users/Sentient07/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sentient07/Theano","description":"Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. It can use GPUs and perform efficient symbolic differentiation.","fork":true,"url":"https://api.github.com/repos/Sentient07/Theano","forks_url":"https://api.github.com/repos/Sentient07/Theano/forks","keys_url":"https://api.github.com/repos/Sentient07/Theano/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sentient07/Theano/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sentient07/Theano/teams","hooks_url":"https://api.github.com/repos/Sentient07/Theano/hooks","issue_events_url":"https://api.github.com/repos/Sentient07/Theano/issues/events{/number}","events_url":"https://api.github.com/repos/Sentient07/Theano/events","assignees_url":"https://api.github.com/repos/Sentient07/Theano/assignees{/user}","branches_url":"https://api.github.com/repos/Sentient07/Theano/branches{/branch}","tags_url":"https://api.github.com/repos/Sentient07/Theano/tags","blobs_url":"https://api.github.com/repos/Sentient07/Theano/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sentient07/Theano/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sentient07/Theano/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sentient07/Theano/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sentient07/Theano/statuses/{sha}","languages_url":"https://api.github.com/repos/Sentient07/Theano/languages","stargazers_url":"https://api.github.com/repos/Sentient07/Theano/stargazers","contributors_url":"https://api.github.com/repos/Sentient07/Theano/contributors","subscribers_url":"https://api.github.com/repos/Sentient07/Theano/subscribers","subscription_url":"https://api.github.com/repos/Sentient07/Theano/subscription","commits_url":"https://api.github.com/repos/Sentient07/Theano/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sentient07/Theano/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sentient07/Theano/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sentient07/Theano/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sentient07/Theano/contents/{+path}","compare_url":"https://api.github.com/repos/Sentient07/Theano/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sentient07/Theano/merges","archive_url":"https://api.github.com/repos/Sentient07/Theano/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sentient07/Theano/downloads","issues_url":"https://api.github.com/repos/Sentient07/Theano/issues{/number}","pulls_url":"https://api.github.com/repos/Sentient07/Theano/pulls{/number}","milestones_url":"https://api.github.com/repos/Sentient07/Theano/milestones{/number}","notifications_url":"https://api.github.com/repos/Sentient07/Theano/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sentient07/Theano/labels{/name}","releases_url":"https://api.github.com/repos/Sentient07/Theano/releases{/id}","deployments_url":"https://api.github.com/repos/Sentient07/Theano/deployments","created_at":"2015-11-23T17:21:47Z","updated_at":"2016-02-10T20:45:26Z","pushed_at":"2016-06-20T14:22:53Z","git_url":"git://github.com/Sentient07/Theano.git","ssh_url":"git@github.com:Sentient07/Theano.git","clone_url":"https://github.com/Sentient07/Theano.git","svn_url":"https://github.com/Sentient07/Theano","homepage":"http://www.deeplearning.net/software/theano","size":53764,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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":"Theano:master","ref":"master","sha":"d9028c7b27a3bb35c7134e6d34124af68d5f6adf","user":{"login":"Theano","id":970517,"avatar_url":"https://avatars.githubusercontent.com/u/970517?v=3","gravatar_id":"","url":"https://api.github.com/users/Theano","html_url":"https://github.com/Theano","followers_url":"https://api.github.com/users/Theano/followers","following_url":"https://api.github.com/users/Theano/following{/other_user}","gists_url":"https://api.github.com/users/Theano/gists{/gist_id}","starred_url":"https://api.github.com/users/Theano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Theano/subscriptions","organizations_url":"https://api.github.com/users/Theano/orgs","repos_url":"https://api.github.com/users/Theano/repos","events_url":"https://api.github.com/users/Theano/events{/privacy}","received_events_url":"https://api.github.com/users/Theano/received_events","type":"Organization","site_admin":false},"repo":{"id":2183193,"name":"Theano","full_name":"Theano/Theano","owner":{"login":"Theano","id":970517,"avatar_url":"https://avatars.githubusercontent.com/u/970517?v=3","gravatar_id":"","url":"https://api.github.com/users/Theano","html_url":"https://github.com/Theano","followers_url":"https://api.github.com/users/Theano/followers","following_url":"https://api.github.com/users/Theano/following{/other_user}","gists_url":"https://api.github.com/users/Theano/gists{/gist_id}","starred_url":"https://api.github.com/users/Theano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Theano/subscriptions","organizations_url":"https://api.github.com/users/Theano/orgs","repos_url":"https://api.github.com/users/Theano/repos","events_url":"https://api.github.com/users/Theano/events{/privacy}","received_events_url":"https://api.github.com/users/Theano/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Theano/Theano","description":"Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently. It can use GPUs and perform efficient symbolic differentiation.","fork":false,"url":"https://api.github.com/repos/Theano/Theano","forks_url":"https://api.github.com/repos/Theano/Theano/forks","keys_url":"https://api.github.com/repos/Theano/Theano/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Theano/Theano/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Theano/Theano/teams","hooks_url":"https://api.github.com/repos/Theano/Theano/hooks","issue_events_url":"https://api.github.com/repos/Theano/Theano/issues/events{/number}","events_url":"https://api.github.com/repos/Theano/Theano/events","assignees_url":"https://api.github.com/repos/Theano/Theano/assignees{/user}","branches_url":"https://api.github.com/repos/Theano/Theano/branches{/branch}","tags_url":"https://api.github.com/repos/Theano/Theano/tags","blobs_url":"https://api.github.com/repos/Theano/Theano/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Theano/Theano/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Theano/Theano/git/refs{/sha}","trees_url":"https://api.github.com/repos/Theano/Theano/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Theano/Theano/statuses/{sha}","languages_url":"https://api.github.com/repos/Theano/Theano/languages","stargazers_url":"https://api.github.com/repos/Theano/Theano/stargazers","contributors_url":"https://api.github.com/repos/Theano/Theano/contributors","subscribers_url":"https://api.github.com/repos/Theano/Theano/subscribers","subscription_url":"https://api.github.com/repos/Theano/Theano/subscription","commits_url":"https://api.github.com/repos/Theano/Theano/commits{/sha}","git_commits_url":"https://api.github.com/repos/Theano/Theano/git/commits{/sha}","comments_url":"https://api.github.com/repos/Theano/Theano/comments{/number}","issue_comment_url":"https://api.github.com/repos/Theano/Theano/issues/comments{/number}","contents_url":"https://api.github.com/repos/Theano/Theano/contents/{+path}","compare_url":"https://api.github.com/repos/Theano/Theano/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Theano/Theano/merges","archive_url":"https://api.github.com/repos/Theano/Theano/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Theano/Theano/downloads","issues_url":"https://api.github.com/repos/Theano/Theano/issues{/number}","pulls_url":"https://api.github.com/repos/Theano/Theano/pulls{/number}","milestones_url":"https://api.github.com/repos/Theano/Theano/milestones{/number}","notifications_url":"https://api.github.com/repos/Theano/Theano/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Theano/Theano/labels{/name}","releases_url":"https://api.github.com/repos/Theano/Theano/releases{/id}","deployments_url":"https://api.github.com/repos/Theano/Theano/deployments","created_at":"2011-08-10T03:48:06Z","updated_at":"2016-06-20T10:33:11Z","pushed_at":"2016-06-20T15:24:29Z","git_url":"git://github.com/Theano/Theano.git","ssh_url":"git@github.com:Theano/Theano.git","clone_url":"https://github.com/Theano/Theano.git","svn_url":"https://github.com/Theano/Theano","homepage":"http://www.deeplearning.net/software/theano","size":74522,"stargazers_count":3971,"watchers_count":3971,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1432,"mirror_url":null,"open_issues_count":690,"forks":1432,"open_issues":690,"watchers":3971,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/4570"},"html":{"href":"https://github.com/Theano/Theano/pull/4570"},"issue":{"href":"https://api.github.com/repos/Theano/Theano/issues/4570"},"comments":{"href":"https://api.github.com/repos/Theano/Theano/issues/4570/comments"},"review_comments":{"href":"https://api.github.com/repos/Theano/Theano/pulls/4570/comments"},"review_comment":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Theano/Theano/pulls/4570/commits"},"statuses":{"href":"https://api.github.com/repos/Theano/Theano/statuses/1736a6ce4ae50c6b3a6b4c286e1f23b8a43a0f33"}}}}
{"actor":{"display_login":"Sentient07"}}