{"action":"created","comment":{"url":"https://api.github.com/repos/Theano/Theano/pulls/comments/29096586","id":29096586,"diff_hunk":"@@ -440,6 +441,24 @@ def local_gpu_dot_to_dot22(node):\n     return False\n \n \n+@local_optimizer([None])\n+def local_assert_no_cpu_op(node):\n+    if not isinstance(node.op, GpuOp) and all([var.owner and isinstance(var.owner.op,\n+        HostFromGpu) for var in node.inputs]) and all([var.owner and\n+            isinstance(var.owner.op, GpuFromHost) for var in node.outputs]):\n+            if config.assert_no_cpu_op == \"warn\":\n+                _logger.warning((\"CPU op %s is detected in the computational\"\n+                                 \" graph\") % node)\n+            elif config.assert_no_cpu_op == \"raise\":\n+                raise RuntimeError(\"The op %s is on CPU.\" % node)\n+            elif config.assert_no_cpu_op == \"pdb\":\n+                pdb.set_trace()\n+    return None\n+\n+if config.assert_no_cpu_op != \"ignore\":\n+    register_opt()(local_assert_no_cpu_op)","path":"theano/sandbox/cuda/opt.py","position":27,"original_position":27,"commit_id":"a341b21555b455fcb2b1576b1e430e0220045805","original_commit_id":"718ff7d26480ce0dc713fe7846ca018474440623","user":{"login":"nouiz","id":180987,"avatar_url":"https://avatars.githubusercontent.com/u/180987?v=3","gravatar_id":"","url":"https://api.github.com/users/nouiz","html_url":"https://github.com/nouiz","followers_url":"https://api.github.com/users/nouiz/followers","following_url":"https://api.github.com/users/nouiz/following{/other_user}","gists_url":"https://api.github.com/users/nouiz/gists{/gist_id}","starred_url":"https://api.github.com/users/nouiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nouiz/subscriptions","organizations_url":"https://api.github.com/users/nouiz/orgs","repos_url":"https://api.github.com/users/nouiz/repos","events_url":"https://api.github.com/users/nouiz/events{/privacy}","received_events_url":"https://api.github.com/users/nouiz/received_events","type":"User","site_admin":false},"body":"assert_no_cpu_op = theano.tensor.opt.in2out(local_assert_no_cpu_op, name='assert_no_cpu_op')\r\ntheano.compile.optdb['specialize_device'].register('assert_no_cpu_op', assert_no_cpu_op)\r\n\r\n","created_at":"2015-04-25T01:41:23Z","updated_at":"2015-04-25T01:41:23Z","html_url":"https://github.com/Theano/Theano/pull/2791#discussion_r29096586","pull_request_url":"https://api.github.com/repos/Theano/Theano/pulls/2791","_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments/29096586"},"html":{"href":"https://github.com/Theano/Theano/pull/2791#discussion_r29096586"},"pull_request":{"href":"https://api.github.com/repos/Theano/Theano/pulls/2791"}}},"pull_request":{"url":"https://api.github.com/repos/Theano/Theano/pulls/2791","id":33591487,"html_url":"https://github.com/Theano/Theano/pull/2791","diff_url":"https://github.com/Theano/Theano/pull/2791.diff","patch_url":"https://github.com/Theano/Theano/pull/2791.patch","issue_url":"https://api.github.com/repos/Theano/Theano/issues/2791","number":2791,"state":"open","locked":false,"title":"Assert no CPU op for #2471","user":{"login":"caglar","id":233292,"avatar_url":"https://avatars.githubusercontent.com/u/233292?v=3","gravatar_id":"","url":"https://api.github.com/users/caglar","html_url":"https://github.com/caglar","followers_url":"https://api.github.com/users/caglar/followers","following_url":"https://api.github.com/users/caglar/following{/other_user}","gists_url":"https://api.github.com/users/caglar/gists{/gist_id}","starred_url":"https://api.github.com/users/caglar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caglar/subscriptions","organizations_url":"https://api.github.com/users/caglar/orgs","repos_url":"https://api.github.com/users/caglar/repos","events_url":"https://api.github.com/users/caglar/events{/privacy}","received_events_url":"https://api.github.com/users/caglar/received_events","type":"User","site_admin":false},"body":"@lamblin I have added a new optimization for the issue #2471. Especially I am not sure how to do the test for this function.","created_at":"2015-04-17T23:50:14Z","updated_at":"2015-04-25T01:41:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"350790100cf7185e2f2aca38d00e93941def02d2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Theano/Theano/pulls/2791/commits","review_comments_url":"https://api.github.com/repos/Theano/Theano/pulls/2791/comments","review_comment_url":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/2791/comments","statuses_url":"https://api.github.com/repos/Theano/Theano/statuses/a341b21555b455fcb2b1576b1e430e0220045805","head":{"label":"caglar:gpu_opt_transfer","ref":"gpu_opt_transfer","sha":"a341b21555b455fcb2b1576b1e430e0220045805","user":{"login":"caglar","id":233292,"avatar_url":"https://avatars.githubusercontent.com/u/233292?v=3","gravatar_id":"","url":"https://api.github.com/users/caglar","html_url":"https://github.com/caglar","followers_url":"https://api.github.com/users/caglar/followers","following_url":"https://api.github.com/users/caglar/following{/other_user}","gists_url":"https://api.github.com/users/caglar/gists{/gist_id}","starred_url":"https://api.github.com/users/caglar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caglar/subscriptions","organizations_url":"https://api.github.com/users/caglar/orgs","repos_url":"https://api.github.com/users/caglar/repos","events_url":"https://api.github.com/users/caglar/events{/privacy}","received_events_url":"https://api.github.com/users/caglar/received_events","type":"User","site_admin":false},"repo":{"id":4730184,"name":"Theano","full_name":"caglar/Theano","owner":{"login":"caglar","id":233292,"avatar_url":"https://avatars.githubusercontent.com/u/233292?v=3","gravatar_id":"","url":"https://api.github.com/users/caglar","html_url":"https://github.com/caglar","followers_url":"https://api.github.com/users/caglar/followers","following_url":"https://api.github.com/users/caglar/following{/other_user}","gists_url":"https://api.github.com/users/caglar/gists{/gist_id}","starred_url":"https://api.github.com/users/caglar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caglar/subscriptions","organizations_url":"https://api.github.com/users/caglar/orgs","repos_url":"https://api.github.com/users/caglar/repos","events_url":"https://api.github.com/users/caglar/events{/privacy}","received_events_url":"https://api.github.com/users/caglar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caglar/Theano","description":"Optimizing GPU-meta-programming code generating array oriented optimizing math compiler in Python","fork":true,"url":"https://api.github.com/repos/caglar/Theano","forks_url":"https://api.github.com/repos/caglar/Theano/forks","keys_url":"https://api.github.com/repos/caglar/Theano/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caglar/Theano/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caglar/Theano/teams","hooks_url":"https://api.github.com/repos/caglar/Theano/hooks","issue_events_url":"https://api.github.com/repos/caglar/Theano/issues/events{/number}","events_url":"https://api.github.com/repos/caglar/Theano/events","assignees_url":"https://api.github.com/repos/caglar/Theano/assignees{/user}","branches_url":"https://api.github.com/repos/caglar/Theano/branches{/branch}","tags_url":"https://api.github.com/repos/caglar/Theano/tags","blobs_url":"https://api.github.com/repos/caglar/Theano/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caglar/Theano/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caglar/Theano/git/refs{/sha}","trees_url":"https://api.github.com/repos/caglar/Theano/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caglar/Theano/statuses/{sha}","languages_url":"https://api.github.com/repos/caglar/Theano/languages","stargazers_url":"https://api.github.com/repos/caglar/Theano/stargazers","contributors_url":"https://api.github.com/repos/caglar/Theano/contributors","subscribers_url":"https://api.github.com/repos/caglar/Theano/subscribers","subscription_url":"https://api.github.com/repos/caglar/Theano/subscription","commits_url":"https://api.github.com/repos/caglar/Theano/commits{/sha}","git_commits_url":"https://api.github.com/repos/caglar/Theano/git/commits{/sha}","comments_url":"https://api.github.com/repos/caglar/Theano/comments{/number}","issue_comment_url":"https://api.github.com/repos/caglar/Theano/issues/comments{/number}","contents_url":"https://api.github.com/repos/caglar/Theano/contents/{+path}","compare_url":"https://api.github.com/repos/caglar/Theano/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caglar/Theano/merges","archive_url":"https://api.github.com/repos/caglar/Theano/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caglar/Theano/downloads","issues_url":"https://api.github.com/repos/caglar/Theano/issues{/number}","pulls_url":"https://api.github.com/repos/caglar/Theano/pulls{/number}","milestones_url":"https://api.github.com/repos/caglar/Theano/milestones{/number}","notifications_url":"https://api.github.com/repos/caglar/Theano/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caglar/Theano/labels{/name}","releases_url":"https://api.github.com/repos/caglar/Theano/releases{/id}","created_at":"2012-06-20T19:08:16Z","updated_at":"2014-05-20T01:10:03Z","pushed_at":"2015-04-25T01:25:15Z","git_url":"git://github.com/caglar/Theano.git","ssh_url":"git@github.com:caglar/Theano.git","clone_url":"https://github.com/caglar/Theano.git","svn_url":"https://github.com/caglar/Theano","homepage":"http://www.deeplearning.net/software/theano","size":29834,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"Theano:master","ref":"master","sha":"27060dbb0f452e279f91ce4ba14050d764622f60","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}","created_at":"2011-08-10T03:48:06Z","updated_at":"2015-04-25T01:23:30Z","pushed_at":"2015-04-25T01:25:15Z","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":47790,"stargazers_count":1400,"watchers_count":1400,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":519,"mirror_url":null,"open_issues_count":367,"forks":519,"open_issues":367,"watchers":1400,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/2791"},"html":{"href":"https://github.com/Theano/Theano/pull/2791"},"issue":{"href":"https://api.github.com/repos/Theano/Theano/issues/2791"},"comments":{"href":"https://api.github.com/repos/Theano/Theano/issues/2791/comments"},"review_comments":{"href":"https://api.github.com/repos/Theano/Theano/pulls/2791/comments"},"review_comment":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Theano/Theano/pulls/2791/commits"},"statuses":{"href":"https://api.github.com/repos/Theano/Theano/statuses/a341b21555b455fcb2b1576b1e430e0220045805"}}}}