{"action":"created","comment":{"url":"https://api.github.com/repos/Theano/Theano/pulls/comments/41076234","id":41076234,"diff_hunk":"@@ -952,23 +954,23 @@ def local_gpu_reshape(node):\n     return False\n \n \n-@register_opt()\n-@local_optimizer([gpu_from_host, tensor.Flatten])\n-def local_gpu_flatten(node):\n-    if isinstance(node.op, GpuFromHost):\n-        host_input = node.inputs[0]\n-        if host_input.owner and \\\n-           isinstance(host_input.owner.op, tensor.Flatten):\n-            outdim = host_input.owner.op.outdim\n-            return [GpuFlatten(outdim)(\n-                as_cuda_ndarray_variable(host_input.owner.inputs[0]))]\n-    if isinstance(node.op, tensor.Flatten):\n-        x, = node.inputs\n-        outdim = node.op.outdim\n-        if x.owner and isinstance(x.owner.op, HostFromGpu):\n-            gpu_x, = x.owner.inputs\n-            return [host_from_gpu(GpuFlatten(outdim)(gpu_x))]\n-    return False\n+#@register_opt()","path":"theano/sandbox/cuda/opt.py","position":41,"original_position":41,"commit_id":"ff5bf104011382e65219405d5dff9e967f6bdff4","original_commit_id":"ff5bf104011382e65219405d5dff9e967f6bdff4","user":{"login":"bouthilx","id":2099418,"avatar_url":"https://avatars.githubusercontent.com/u/2099418?v=3","gravatar_id":"","url":"https://api.github.com/users/bouthilx","html_url":"https://github.com/bouthilx","followers_url":"https://api.github.com/users/bouthilx/followers","following_url":"https://api.github.com/users/bouthilx/following{/other_user}","gists_url":"https://api.github.com/users/bouthilx/gists{/gist_id}","starred_url":"https://api.github.com/users/bouthilx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bouthilx/subscriptions","organizations_url":"https://api.github.com/users/bouthilx/orgs","repos_url":"https://api.github.com/users/bouthilx/repos","events_url":"https://api.github.com/users/bouthilx/events{/privacy}","received_events_url":"https://api.github.com/users/bouthilx/received_events","type":"User","site_admin":false},"body":"Having a look at it, the optimization will fail. You can't replace Reshape by GpuFlatten in every cases. Leave Flatten there, theano already have an optimization for Reshape -> GpuReshape.","created_at":"2015-10-02T22:52:42Z","updated_at":"2015-10-02T22:52:42Z","html_url":"https://github.com/Theano/Theano/pull/3480#discussion_r41076234","pull_request_url":"https://api.github.com/repos/Theano/Theano/pulls/3480","_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments/41076234"},"html":{"href":"https://github.com/Theano/Theano/pull/3480#discussion_r41076234"},"pull_request":{"href":"https://api.github.com/repos/Theano/Theano/pulls/3480"}}},"pull_request":{"url":"https://api.github.com/repos/Theano/Theano/pulls/3480","id":46587616,"html_url":"https://github.com/Theano/Theano/pull/3480","diff_url":"https://github.com/Theano/Theano/pull/3480.diff","patch_url":"https://github.com/Theano/Theano/pull/3480.patch","issue_url":"https://api.github.com/repos/Theano/Theano/issues/3480","number":3480,"state":"open","locked":false,"title":"Issue950","user":{"login":"SinaHonari","id":3536552,"avatar_url":"https://avatars.githubusercontent.com/u/3536552?v=3","gravatar_id":"","url":"https://api.github.com/users/SinaHonari","html_url":"https://github.com/SinaHonari","followers_url":"https://api.github.com/users/SinaHonari/followers","following_url":"https://api.github.com/users/SinaHonari/following{/other_user}","gists_url":"https://api.github.com/users/SinaHonari/gists{/gist_id}","starred_url":"https://api.github.com/users/SinaHonari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SinaHonari/subscriptions","organizations_url":"https://api.github.com/users/SinaHonari/orgs","repos_url":"https://api.github.com/users/SinaHonari/repos","events_url":"https://api.github.com/users/SinaHonari/events{/privacy}","received_events_url":"https://api.github.com/users/SinaHonari/received_events","type":"User","site_admin":false},"body":"Fixes issue #950 ","created_at":"2015-10-01T23:02:17Z","updated_at":"2015-10-02T22:52:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6f42aa2d1cfe85c2a1cbea73b71b4e56e4de1db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Theano/Theano/pulls/3480/commits","review_comments_url":"https://api.github.com/repos/Theano/Theano/pulls/3480/comments","review_comment_url":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/3480/comments","statuses_url":"https://api.github.com/repos/Theano/Theano/statuses/ff5bf104011382e65219405d5dff9e967f6bdff4","head":{"label":"SinaHonari:issue950","ref":"issue950","sha":"ff5bf104011382e65219405d5dff9e967f6bdff4","user":{"login":"SinaHonari","id":3536552,"avatar_url":"https://avatars.githubusercontent.com/u/3536552?v=3","gravatar_id":"","url":"https://api.github.com/users/SinaHonari","html_url":"https://github.com/SinaHonari","followers_url":"https://api.github.com/users/SinaHonari/followers","following_url":"https://api.github.com/users/SinaHonari/following{/other_user}","gists_url":"https://api.github.com/users/SinaHonari/gists{/gist_id}","starred_url":"https://api.github.com/users/SinaHonari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SinaHonari/subscriptions","organizations_url":"https://api.github.com/users/SinaHonari/orgs","repos_url":"https://api.github.com/users/SinaHonari/repos","events_url":"https://api.github.com/users/SinaHonari/events{/privacy}","received_events_url":"https://api.github.com/users/SinaHonari/received_events","type":"User","site_admin":false},"repo":{"id":9309289,"name":"Theano","full_name":"SinaHonari/Theano","owner":{"login":"SinaHonari","id":3536552,"avatar_url":"https://avatars.githubusercontent.com/u/3536552?v=3","gravatar_id":"","url":"https://api.github.com/users/SinaHonari","html_url":"https://github.com/SinaHonari","followers_url":"https://api.github.com/users/SinaHonari/followers","following_url":"https://api.github.com/users/SinaHonari/following{/other_user}","gists_url":"https://api.github.com/users/SinaHonari/gists{/gist_id}","starred_url":"https://api.github.com/users/SinaHonari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SinaHonari/subscriptions","organizations_url":"https://api.github.com/users/SinaHonari/orgs","repos_url":"https://api.github.com/users/SinaHonari/repos","events_url":"https://api.github.com/users/SinaHonari/events{/privacy}","received_events_url":"https://api.github.com/users/SinaHonari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SinaHonari/Theano","description":"Optimizing GPU-meta-programming code generating array oriented optimizing math compiler in Python","fork":true,"url":"https://api.github.com/repos/SinaHonari/Theano","forks_url":"https://api.github.com/repos/SinaHonari/Theano/forks","keys_url":"https://api.github.com/repos/SinaHonari/Theano/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SinaHonari/Theano/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SinaHonari/Theano/teams","hooks_url":"https://api.github.com/repos/SinaHonari/Theano/hooks","issue_events_url":"https://api.github.com/repos/SinaHonari/Theano/issues/events{/number}","events_url":"https://api.github.com/repos/SinaHonari/Theano/events","assignees_url":"https://api.github.com/repos/SinaHonari/Theano/assignees{/user}","branches_url":"https://api.github.com/repos/SinaHonari/Theano/branches{/branch}","tags_url":"https://api.github.com/repos/SinaHonari/Theano/tags","blobs_url":"https://api.github.com/repos/SinaHonari/Theano/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SinaHonari/Theano/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SinaHonari/Theano/git/refs{/sha}","trees_url":"https://api.github.com/repos/SinaHonari/Theano/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SinaHonari/Theano/statuses/{sha}","languages_url":"https://api.github.com/repos/SinaHonari/Theano/languages","stargazers_url":"https://api.github.com/repos/SinaHonari/Theano/stargazers","contributors_url":"https://api.github.com/repos/SinaHonari/Theano/contributors","subscribers_url":"https://api.github.com/repos/SinaHonari/Theano/subscribers","subscription_url":"https://api.github.com/repos/SinaHonari/Theano/subscription","commits_url":"https://api.github.com/repos/SinaHonari/Theano/commits{/sha}","git_commits_url":"https://api.github.com/repos/SinaHonari/Theano/git/commits{/sha}","comments_url":"https://api.github.com/repos/SinaHonari/Theano/comments{/number}","issue_comment_url":"https://api.github.com/repos/SinaHonari/Theano/issues/comments{/number}","contents_url":"https://api.github.com/repos/SinaHonari/Theano/contents/{+path}","compare_url":"https://api.github.com/repos/SinaHonari/Theano/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SinaHonari/Theano/merges","archive_url":"https://api.github.com/repos/SinaHonari/Theano/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SinaHonari/Theano/downloads","issues_url":"https://api.github.com/repos/SinaHonari/Theano/issues{/number}","pulls_url":"https://api.github.com/repos/SinaHonari/Theano/pulls{/number}","milestones_url":"https://api.github.com/repos/SinaHonari/Theano/milestones{/number}","notifications_url":"https://api.github.com/repos/SinaHonari/Theano/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SinaHonari/Theano/labels{/name}","releases_url":"https://api.github.com/repos/SinaHonari/Theano/releases{/id}","created_at":"2013-04-08T23:46:57Z","updated_at":"2013-04-18T01:28:29Z","pushed_at":"2015-10-01T23:23:47Z","git_url":"git://github.com/SinaHonari/Theano.git","ssh_url":"git@github.com:SinaHonari/Theano.git","clone_url":"https://github.com/SinaHonari/Theano.git","svn_url":"https://github.com/SinaHonari/Theano","homepage":"http://www.deeplearning.net/software/theano","size":43664,"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":"cfd111404b980b6e96d93d3b78adc55649fcb22f","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-10-02T17:23:27Z","pushed_at":"2015-10-02T20:26:04Z","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":65511,"stargazers_count":2084,"watchers_count":2084,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":752,"mirror_url":null,"open_issues_count":493,"forks":752,"open_issues":493,"watchers":2084,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/3480"},"html":{"href":"https://github.com/Theano/Theano/pull/3480"},"issue":{"href":"https://api.github.com/repos/Theano/Theano/issues/3480"},"comments":{"href":"https://api.github.com/repos/Theano/Theano/issues/3480/comments"},"review_comments":{"href":"https://api.github.com/repos/Theano/Theano/pulls/3480/comments"},"review_comment":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Theano/Theano/pulls/3480/commits"},"statuses":{"href":"https://api.github.com/repos/Theano/Theano/statuses/ff5bf104011382e65219405d5dff9e967f6bdff4"}}}}