{"action":"created","comment":{"url":"https://api.github.com/repos/Theano/Theano/pulls/comments/46866447","id":46866447,"diff_hunk":"@@ -777,77 +782,49 @@ def local_assert(node, context_name):\n \n @register_opt('fast_compile')\n @op_lifter([ConvOp])\n-def local_gpu_conv(node, context_name):\n-    def GpuConvOp_from_ConvOp(op):\n-        logical_img_hw = None\n-\n-        if op.kshp_logical is not None and op.kshp_logical != op.kshp:\n-            return None\n-\n-        ret = GpuConv(border_mode=op.out_mode,\n-                      subsample=(op.dx, op.dy),\n-                      logical_img_hw=logical_img_hw,\n-                      logical_kern_hw=op.kshp_logical,\n-                      logical_kern_align_top=op.kshp_logical_top_aligned,\n-                      kshp=op.kshp,\n-                      version=op.version,\n-                      direction_hint=op.direction_hint,\n-                      verbose=op.verbose,\n-                      imshp=op.imshp,\n-                      nkern=op.nkern,\n-                      bsize=op.bsize,\n-                      fft_opt=op.fft_opt)\n-        if op.imshp_logical is not None:\n-            logical_img_hw = op.imshp_logical[1:3]\n-            if logical_img_hw != op.imshp[1:3]:\n-                rstride = int(numpy.ceil(op.imshp_logical[1] /\n-                                         float(op.imshp[1])))\n-                cstride = int(numpy.ceil(op.imshp_logical[2] /\n-                                         float(op.imshp[2])))\n-\n-                def make_graph(img, kern):\n-                    buf = tensor.alloc(numpy.asarray(0, dtype=img.dtype),\n-                                       img.shape[0], *op.imshp_logical)\n-                    img = tensor.set_subtensor(buf[:, :, ::rstride, ::cstride],\n-                                               img)\n-                    img = GpuFromHost(context_name)(img)\n-                    return ret(img, kern)\n-\n-                return make_graph\n-        return ret\n-\n-    def values_eq_approx(a, b):\n-        \"\"\"\n-        This fct is needed to don't have DebugMode raise useless\n-        error due to ronding error.\n-\n-        This happen as We reduce on the two last dimensions, so this\n-        can raise the absolute error if the number of element we\n-        reduce on is significant.\n-\n-        \"\"\"\n-        assert a.ndim == 4\n-        atol = None\n-        if a.shape[-1] * a.shape[-2] > 100:\n-            # For float32 the default atol is 1e-5\n-            atol = 3e-5\n-        return GpuArrayType.values_eq_approx(a, b, atol=atol)\n-\n-    img, kern = node.inputs\n-    gpu_conv = GpuConvOp_from_ConvOp(node.op)\n-    if gpu_conv is None:\n-        return\n-    out = gpu_conv(GpuFromHost(context_name)(img),\n-                   GpuFromHost(context_name)(kern))\n-    assert isinstance(out.type, GpuArrayType)\n-    # Make sure to keep the broadcastable pattern of the original\n-    # convolution even if we might gain or lose some due to different\n-    # information at the node level.\n-    out = tensor.patternbroadcast(out, node.outputs[0].broadcastable)\n-    out.values_eq_approx = values_eq_approx\n-    return [out]\n-\n-# Register this here so that it goes after 'local_gpu_conv'\n+def local_error_convop(node, context_name):\n+    assert False, \"\"\"\n+ConvOp does not work with the gpuarray backend.\n+\n+Use the new convolution interface to have GPU convolution working:\n+theano.tensor.nnet.conv2d()\n+\"\"\"\n+\n+\n+# This deals with any abstract convs that have a transfer somewhere\n+@register_opt('fast_compile')\n+@op_lifter([AbstractConv2d,\n+            AbstractConv2d_gradWeights,\n+            AbstractConv2d_gradInputs])\n+def local_lift_abstractconv2d(node, context_name):\n+    inps = list(node.inputs)\n+    inps[0] = as_gpuarray_variable(node.inputs[0],\n+                                   context_name=context_name)\n+    inps[1] = as_gpuarray_variable(node.inputs[1],\n+                                   context_name=context_name)\n+    return [node.op(*inps)]\n+\n+\n+# This will deal with ops that don't have an explicit transfer but\n+# have one of their inputs on the GPU already and the other not on the\n+# GPU (to avoid endlessly replacing things).\n+@register_opt('fast_compile')\n+@local_optimizer([AbstractConv2d,\n+                  AbstractConv2d_gradWeights,\n+                  AbstractConv2d_gradInputs])\n+def local_gpu_abstractconv2d(node):\n+    if isinstance(node.op, BaseAbstractConv2d):\n+        if ((isinstance(node.inputs[0].type, GpuArrayType) or\n+             isinstance(node.inputs[1].type, GpuArrayType)) and\n+            not (isinstance(node.inputs[0].type, GpuArrayType) or\n+                 isinstance(node.inputs[1].type, GpuArrayType))):","path":"theano/sandbox/gpuarray/opt.py","position":132,"original_position":132,"commit_id":"ec38198393192d6b97af2b17fbae88c174ea66fc","original_commit_id":"ec38198393192d6b97af2b17fbae88c174ea66fc","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":"The second part of the condition \" not (....)\" seem useless. I think the total if will always be False. Did you wanted the not to be like this:\r\n\r\n(not isinstance(...) or not isinstance(...))","created_at":"2015-12-07T19:42:07Z","updated_at":"2015-12-07T19:42:07Z","html_url":"https://github.com/Theano/Theano/pull/3737#discussion_r46866447","pull_request_url":"https://api.github.com/repos/Theano/Theano/pulls/3737","_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments/46866447"},"html":{"href":"https://github.com/Theano/Theano/pull/3737#discussion_r46866447"},"pull_request":{"href":"https://api.github.com/repos/Theano/Theano/pulls/3737"}}},"pull_request":{"url":"https://api.github.com/repos/Theano/Theano/pulls/3737","id":52620355,"html_url":"https://github.com/Theano/Theano/pull/3737","diff_url":"https://github.com/Theano/Theano/pull/3737.diff","patch_url":"https://github.com/Theano/Theano/pull/3737.patch","issue_url":"https://api.github.com/repos/Theano/Theano/issues/3737","number":3737,"state":"open","locked":false,"title":"Gpuarray abstractconv","user":{"login":"lamblin","id":178249,"avatar_url":"https://avatars.githubusercontent.com/u/178249?v=3","gravatar_id":"","url":"https://api.github.com/users/lamblin","html_url":"https://github.com/lamblin","followers_url":"https://api.github.com/users/lamblin/followers","following_url":"https://api.github.com/users/lamblin/following{/other_user}","gists_url":"https://api.github.com/users/lamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/lamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamblin/subscriptions","organizations_url":"https://api.github.com/users/lamblin/orgs","repos_url":"https://api.github.com/users/lamblin/repos","events_url":"https://api.github.com/users/lamblin/events{/privacy}","received_events_url":"https://api.github.com/users/lamblin/received_events","type":"User","site_admin":false},"body":"Rebased version of #3676 with some additional fixes.\r\nI've run the tests in `gpuarray/tests/test_abstractconv.py` locally on a TitanX and they pass, but I'll run them on the whole `gpuarray` overnight to be sure.","created_at":"2015-12-04T01:52:07Z","updated_at":"2015-12-07T19:42:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d07d021c8f2d88ed461f4e6b1d680d2a419c2dcf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Theano/Theano/pulls/3737/commits","review_comments_url":"https://api.github.com/repos/Theano/Theano/pulls/3737/comments","review_comment_url":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/3737/comments","statuses_url":"https://api.github.com/repos/Theano/Theano/statuses/ec38198393192d6b97af2b17fbae88c174ea66fc","head":{"label":"lamblin:gpuarray_abstractconv","ref":"gpuarray_abstractconv","sha":"ec38198393192d6b97af2b17fbae88c174ea66fc","user":{"login":"lamblin","id":178249,"avatar_url":"https://avatars.githubusercontent.com/u/178249?v=3","gravatar_id":"","url":"https://api.github.com/users/lamblin","html_url":"https://github.com/lamblin","followers_url":"https://api.github.com/users/lamblin/followers","following_url":"https://api.github.com/users/lamblin/following{/other_user}","gists_url":"https://api.github.com/users/lamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/lamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamblin/subscriptions","organizations_url":"https://api.github.com/users/lamblin/orgs","repos_url":"https://api.github.com/users/lamblin/repos","events_url":"https://api.github.com/users/lamblin/events{/privacy}","received_events_url":"https://api.github.com/users/lamblin/received_events","type":"User","site_admin":false},"repo":{"id":2431789,"name":"Theano","full_name":"lamblin/Theano","owner":{"login":"lamblin","id":178249,"avatar_url":"https://avatars.githubusercontent.com/u/178249?v=3","gravatar_id":"","url":"https://api.github.com/users/lamblin","html_url":"https://github.com/lamblin","followers_url":"https://api.github.com/users/lamblin/followers","following_url":"https://api.github.com/users/lamblin/following{/other_user}","gists_url":"https://api.github.com/users/lamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/lamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamblin/subscriptions","organizations_url":"https://api.github.com/users/lamblin/orgs","repos_url":"https://api.github.com/users/lamblin/repos","events_url":"https://api.github.com/users/lamblin/events{/privacy}","received_events_url":"https://api.github.com/users/lamblin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lamblin/Theano","description":"Optimizing GPU-meta-programming code generating array oriented optimizing math compiler in Python","fork":true,"url":"https://api.github.com/repos/lamblin/Theano","forks_url":"https://api.github.com/repos/lamblin/Theano/forks","keys_url":"https://api.github.com/repos/lamblin/Theano/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lamblin/Theano/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lamblin/Theano/teams","hooks_url":"https://api.github.com/repos/lamblin/Theano/hooks","issue_events_url":"https://api.github.com/repos/lamblin/Theano/issues/events{/number}","events_url":"https://api.github.com/repos/lamblin/Theano/events","assignees_url":"https://api.github.com/repos/lamblin/Theano/assignees{/user}","branches_url":"https://api.github.com/repos/lamblin/Theano/branches{/branch}","tags_url":"https://api.github.com/repos/lamblin/Theano/tags","blobs_url":"https://api.github.com/repos/lamblin/Theano/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lamblin/Theano/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lamblin/Theano/git/refs{/sha}","trees_url":"https://api.github.com/repos/lamblin/Theano/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lamblin/Theano/statuses/{sha}","languages_url":"https://api.github.com/repos/lamblin/Theano/languages","stargazers_url":"https://api.github.com/repos/lamblin/Theano/stargazers","contributors_url":"https://api.github.com/repos/lamblin/Theano/contributors","subscribers_url":"https://api.github.com/repos/lamblin/Theano/subscribers","subscription_url":"https://api.github.com/repos/lamblin/Theano/subscription","commits_url":"https://api.github.com/repos/lamblin/Theano/commits{/sha}","git_commits_url":"https://api.github.com/repos/lamblin/Theano/git/commits{/sha}","comments_url":"https://api.github.com/repos/lamblin/Theano/comments{/number}","issue_comment_url":"https://api.github.com/repos/lamblin/Theano/issues/comments{/number}","contents_url":"https://api.github.com/repos/lamblin/Theano/contents/{+path}","compare_url":"https://api.github.com/repos/lamblin/Theano/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lamblin/Theano/merges","archive_url":"https://api.github.com/repos/lamblin/Theano/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lamblin/Theano/downloads","issues_url":"https://api.github.com/repos/lamblin/Theano/issues{/number}","pulls_url":"https://api.github.com/repos/lamblin/Theano/pulls{/number}","milestones_url":"https://api.github.com/repos/lamblin/Theano/milestones{/number}","notifications_url":"https://api.github.com/repos/lamblin/Theano/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lamblin/Theano/labels{/name}","releases_url":"https://api.github.com/repos/lamblin/Theano/releases{/id}","created_at":"2011-09-21T18:31:42Z","updated_at":"2015-02-17T21:53:20Z","pushed_at":"2015-12-05T02:16:09Z","git_url":"git://github.com/lamblin/Theano.git","ssh_url":"git@github.com:lamblin/Theano.git","clone_url":"https://github.com/lamblin/Theano.git","svn_url":"https://github.com/lamblin/Theano","homepage":"http://www.deeplearning.net/software/theano","size":46369,"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":"521852776be62929f5f4151cacff348f60f60d73","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-12-07T16:35:49Z","pushed_at":"2015-12-07T15:02:24Z","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":55018,"stargazers_count":2540,"watchers_count":2540,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":902,"mirror_url":null,"open_issues_count":544,"forks":902,"open_issues":544,"watchers":2540,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/3737"},"html":{"href":"https://github.com/Theano/Theano/pull/3737"},"issue":{"href":"https://api.github.com/repos/Theano/Theano/issues/3737"},"comments":{"href":"https://api.github.com/repos/Theano/Theano/issues/3737/comments"},"review_comments":{"href":"https://api.github.com/repos/Theano/Theano/pulls/3737/comments"},"review_comment":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Theano/Theano/pulls/3737/commits"},"statuses":{"href":"https://api.github.com/repos/Theano/Theano/statuses/ec38198393192d6b97af2b17fbae88c174ea66fc"}}}}