{"action":"closed","issue":{"url":"https://api.github.com/repos/Element-Research/rnn/issues/147","repository_url":"https://api.github.com/repos/Element-Research/rnn","labels_url":"https://api.github.com/repos/Element-Research/rnn/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/Element-Research/rnn/issues/147/comments","events_url":"https://api.github.com/repos/Element-Research/rnn/issues/147/events","html_url":"https://github.com/Element-Research/rnn/issues/147","id":138015683,"number":147,"title":"gradInput check in rnn/AbstractRecurrent.lua","user":{"login":"harrywy","id":1187168,"avatar_url":"https://avatars.githubusercontent.com/u/1187168?v=3","gravatar_id":"","url":"https://api.github.com/users/harrywy","html_url":"https://github.com/harrywy","followers_url":"https://api.github.com/users/harrywy/followers","following_url":"https://api.github.com/users/harrywy/following{/other_user}","gists_url":"https://api.github.com/users/harrywy/gists{/gist_id}","starred_url":"https://api.github.com/users/harrywy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harrywy/subscriptions","organizations_url":"https://api.github.com/users/harrywy/orgs","repos_url":"https://api.github.com/users/harrywy/repos","events_url":"https://api.github.com/users/harrywy/events{/privacy}","received_events_url":"https://api.github.com/users/harrywy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-02T22:42:40Z","updated_at":"2016-03-06T17:24:12Z","closed_at":"2016-03-06T17:24:12Z","body":"Hi \r\nI have found that the gradInput check in rnn/AbstractRecurrent.lua is annoying.\r\nThere might be some cases that we don't want to calculate a gradient with respect to input. (I am working on such a problem.) \r\n\r\n```lua\r\nfunction AbstractRecurrent:updateGradInput(input, gradOutput)  \r\n   -- updateGradInput should be called in reverse order of time\r\n   self.updateGradInputStep = self.updateGradInputStep or self.step\r\n   \r\n   -- BPTT for one time-step\r\n   self.gradInput = self:_updateGradInput(input, gradOutput, self.updateGradInputStep)\r\n   \r\n   self.updateGradInputStep = self.updateGradInputStep - 1\r\n   **assert(self.gradInput, \"Missing gradInput\")**\r\n   return self.gradInput\r\nend\r\n```\r\n\r\nSo would you mind comment this line out?\r\nBest,\r\nWenyi"}}