{"action":"created","comment":{"url":"https://api.github.com/repos/Theano/Theano/pulls/comments/29683057","id":29683057,"diff_hunk":"@@ -1155,8 +1155,22 @@ def c_code(self, node, name, (x, low, hi), (z, ), sub):\n         return (\"%(z)s = %(x)s %(cmp1)s %(low)s &&\"\n                 \" %(x)s %(cmp2)s %(hi)s;\" % locals())\n \n+    def get_grad(self, elem):\n+        if elem.type in complex_types:\n+            msg = \"No gradient implemented for complex numbers in\\\n+                                 class scalar.basic.InRange\"\n+            raise NotImplementedError(msg)\n+        elif elem.type in discrete_types:\n+            return elem.zeros_like().astype(theano.config.floatX)\n+        else:\n+            return elem.zeros_like()\n+\n     def grad(self, (x, low, hi), (gz, )):\n-        return None, None, None\n+        grads = []\n+        for elem in [x, low, hi]:\n+            grads.append(get_grad(elem))","path":"theano/scalar/basic.py","position":18,"original_position":18,"commit_id":"9f7b2e71ef5a46157b4090f1d30434b5a9aba305","original_commit_id":"9f7b2e71ef5a46157b4090f1d30434b5a9aba305","user":{"login":"abergeron","id":1002504,"avatar_url":"https://avatars.githubusercontent.com/u/1002504?v=3","gravatar_id":"","url":"https://api.github.com/users/abergeron","html_url":"https://github.com/abergeron","followers_url":"https://api.github.com/users/abergeron/followers","following_url":"https://api.github.com/users/abergeron/following{/other_user}","gists_url":"https://api.github.com/users/abergeron/gists{/gist_id}","starred_url":"https://api.github.com/users/abergeron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abergeron/subscriptions","organizations_url":"https://api.github.com/users/abergeron/orgs","repos_url":"https://api.github.com/users/abergeron/repos","events_url":"https://api.github.com/users/abergeron/events{/privacy}","received_events_url":"https://api.github.com/users/abergeron/received_events","type":"User","site_admin":false},"body":"Ok I've made https://github.com/Theano/Theano/pull/2877 to fix the problem, but adding a test is good.","created_at":"2015-05-05T15:56:56Z","updated_at":"2015-05-05T15:56:56Z","html_url":"https://github.com/Theano/Theano/pull/2750#discussion_r29683057","pull_request_url":"https://api.github.com/repos/Theano/Theano/pulls/2750","_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments/29683057"},"html":{"href":"https://github.com/Theano/Theano/pull/2750#discussion_r29683057"},"pull_request":{"href":"https://api.github.com/repos/Theano/Theano/pulls/2750"}}},"pull_request":{"url":"https://api.github.com/repos/Theano/Theano/pulls/2750","id":33008055,"html_url":"https://github.com/Theano/Theano/pull/2750","diff_url":"https://github.com/Theano/Theano/pull/2750.diff","patch_url":"https://github.com/Theano/Theano/pull/2750.patch","issue_url":"https://api.github.com/repos/Theano/Theano/issues/2750","number":2750,"state":"closed","locked":false,"title":"Tracking Ops with grad methods returning None","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":"","created_at":"2015-04-10T00:04:16Z","updated_at":"2015-05-05T15:56:56Z","closed_at":"2015-04-15T17:46:28Z","merged_at":"2015-04-15T17:46:28Z","merge_commit_sha":"aa6e1628d5647a74c8f52dc202d93706f2f9dbec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Theano/Theano/pulls/2750/commits","review_comments_url":"https://api.github.com/repos/Theano/Theano/pulls/2750/comments","review_comment_url":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/2750/comments","statuses_url":"https://api.github.com/repos/Theano/Theano/statuses/9f7b2e71ef5a46157b4090f1d30434b5a9aba305","head":{"label":"SinaHonari:issue2500","ref":"issue2500","sha":"9f7b2e71ef5a46157b4090f1d30434b5a9aba305","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-05-01T23:41:49Z","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":31379,"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":"2b2cd6470c18f936377ec5f9fa8d039a4d07c8ee","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-05-05T15:08:17Z","pushed_at":"2015-05-05T15:55:48Z","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":59532,"stargazers_count":1432,"watchers_count":1432,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":536,"mirror_url":null,"open_issues_count":384,"forks":536,"open_issues":384,"watchers":1432,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Theano/Theano/pulls/2750"},"html":{"href":"https://github.com/Theano/Theano/pull/2750"},"issue":{"href":"https://api.github.com/repos/Theano/Theano/issues/2750"},"comments":{"href":"https://api.github.com/repos/Theano/Theano/issues/2750/comments"},"review_comments":{"href":"https://api.github.com/repos/Theano/Theano/pulls/2750/comments"},"review_comment":{"href":"https://api.github.com/repos/Theano/Theano/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Theano/Theano/pulls/2750/commits"},"statuses":{"href":"https://api.github.com/repos/Theano/Theano/statuses/9f7b2e71ef5a46157b4090f1d30434b5a9aba305"}}}}