{"action":"created","comment":{"url":"https://api.github.com/repos/torch/nngraph/pulls/comments/61400575","id":61400575,"diff_hunk":"@@ -24,7 +24,17 @@ end\n function ModuleFromCriterion:updateGradInput(input, gradOutput)\n    local prediction, target = unpack(input)\n    local gradPrediction = self.criterion:updateGradInput(prediction, target)\n-   self.gradInput[1]:resizeAs(gradPrediction):copy(gradPrediction):mul(gradOutput[1])\n+   if type(gradPrediction) == 'table' then\n+      if type(self.gradInput[1]) ~= 'table' then\n+        self.gradInput[1] = gradPrediction","path":"ModuleFromCriterion.lua","position":7,"original_position":7,"commit_id":"d2316ef6bd519fc6b1e1230121ff026e38380086","original_commit_id":"d2316ef6bd519fc6b1e1230121ff026e38380086","user":{"login":"abhitopia","id":12864026,"avatar_url":"https://avatars.githubusercontent.com/u/12864026?v=3","gravatar_id":"","url":"https://api.github.com/users/abhitopia","html_url":"https://github.com/abhitopia","followers_url":"https://api.github.com/users/abhitopia/followers","following_url":"https://api.github.com/users/abhitopia/following{/other_user}","gists_url":"https://api.github.com/users/abhitopia/gists{/gist_id}","starred_url":"https://api.github.com/users/abhitopia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhitopia/subscriptions","organizations_url":"https://api.github.com/users/abhitopia/orgs","repos_url":"https://api.github.com/users/abhitopia/repos","events_url":"https://api.github.com/users/abhitopia/events{/privacy}","received_events_url":"https://api.github.com/users/abhitopia/received_events","type":"User","site_admin":false},"body":"Not really, check out line 32 (for table) and line 36 (for tensor).","created_at":"2016-04-28T09:47:18Z","updated_at":"2016-04-28T09:47:18Z","html_url":"https://github.com/torch/nngraph/pull/108#discussion_r61400575","pull_request_url":"https://api.github.com/repos/torch/nngraph/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/torch/nngraph/pulls/comments/61400575"},"html":{"href":"https://github.com/torch/nngraph/pull/108#discussion_r61400575"},"pull_request":{"href":"https://api.github.com/repos/torch/nngraph/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/torch/nngraph/pulls/108","id":63003582,"html_url":"https://github.com/torch/nngraph/pull/108","diff_url":"https://github.com/torch/nngraph/pull/108.diff","patch_url":"https://github.com/torch/nngraph/pull/108.patch","issue_url":"https://api.github.com/repos/torch/nngraph/issues/108","number":108,"state":"open","locked":false,"title":"Fix to make compatible with MarginRankingCriterion","user":{"login":"abhitopia","id":12864026,"avatar_url":"https://avatars.githubusercontent.com/u/12864026?v=3","gravatar_id":"","url":"https://api.github.com/users/abhitopia","html_url":"https://github.com/abhitopia","followers_url":"https://api.github.com/users/abhitopia/followers","following_url":"https://api.github.com/users/abhitopia/following{/other_user}","gists_url":"https://api.github.com/users/abhitopia/gists{/gist_id}","starred_url":"https://api.github.com/users/abhitopia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhitopia/subscriptions","organizations_url":"https://api.github.com/users/abhitopia/orgs","repos_url":"https://api.github.com/users/abhitopia/repos","events_url":"https://api.github.com/users/abhitopia/events{/privacy}","received_events_url":"https://api.github.com/users/abhitopia/received_events","type":"User","site_admin":false},"body":"Before the fix ModuleFromCriterion assumes that gradPrediction (line 26) is a tensor. This assumption breaks for criterions like MarginRankingCriterion where it is a table instead. Adding code to make it compatible for criterions where prediction (as well as gradPrediction) can be a table.","created_at":"2016-03-16T01:47:49Z","updated_at":"2016-04-28T09:47:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa4aa0597d986a7cee65c1d82d28ac0c93b12e59","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/torch/nngraph/pulls/108/commits","review_comments_url":"https://api.github.com/repos/torch/nngraph/pulls/108/comments","review_comment_url":"https://api.github.com/repos/torch/nngraph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/torch/nngraph/issues/108/comments","statuses_url":"https://api.github.com/repos/torch/nngraph/statuses/d2316ef6bd519fc6b1e1230121ff026e38380086","head":{"label":"abhitopia:master","ref":"master","sha":"d2316ef6bd519fc6b1e1230121ff026e38380086","user":{"login":"abhitopia","id":12864026,"avatar_url":"https://avatars.githubusercontent.com/u/12864026?v=3","gravatar_id":"","url":"https://api.github.com/users/abhitopia","html_url":"https://github.com/abhitopia","followers_url":"https://api.github.com/users/abhitopia/followers","following_url":"https://api.github.com/users/abhitopia/following{/other_user}","gists_url":"https://api.github.com/users/abhitopia/gists{/gist_id}","starred_url":"https://api.github.com/users/abhitopia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhitopia/subscriptions","organizations_url":"https://api.github.com/users/abhitopia/orgs","repos_url":"https://api.github.com/users/abhitopia/repos","events_url":"https://api.github.com/users/abhitopia/events{/privacy}","received_events_url":"https://api.github.com/users/abhitopia/received_events","type":"User","site_admin":false},"repo":{"id":53990770,"name":"nngraph","full_name":"abhitopia/nngraph","owner":{"login":"abhitopia","id":12864026,"avatar_url":"https://avatars.githubusercontent.com/u/12864026?v=3","gravatar_id":"","url":"https://api.github.com/users/abhitopia","html_url":"https://github.com/abhitopia","followers_url":"https://api.github.com/users/abhitopia/followers","following_url":"https://api.github.com/users/abhitopia/following{/other_user}","gists_url":"https://api.github.com/users/abhitopia/gists{/gist_id}","starred_url":"https://api.github.com/users/abhitopia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhitopia/subscriptions","organizations_url":"https://api.github.com/users/abhitopia/orgs","repos_url":"https://api.github.com/users/abhitopia/repos","events_url":"https://api.github.com/users/abhitopia/events{/privacy}","received_events_url":"https://api.github.com/users/abhitopia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abhitopia/nngraph","description":"Graph Computation for nn","fork":true,"url":"https://api.github.com/repos/abhitopia/nngraph","forks_url":"https://api.github.com/repos/abhitopia/nngraph/forks","keys_url":"https://api.github.com/repos/abhitopia/nngraph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abhitopia/nngraph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abhitopia/nngraph/teams","hooks_url":"https://api.github.com/repos/abhitopia/nngraph/hooks","issue_events_url":"https://api.github.com/repos/abhitopia/nngraph/issues/events{/number}","events_url":"https://api.github.com/repos/abhitopia/nngraph/events","assignees_url":"https://api.github.com/repos/abhitopia/nngraph/assignees{/user}","branches_url":"https://api.github.com/repos/abhitopia/nngraph/branches{/branch}","tags_url":"https://api.github.com/repos/abhitopia/nngraph/tags","blobs_url":"https://api.github.com/repos/abhitopia/nngraph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abhitopia/nngraph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abhitopia/nngraph/git/refs{/sha}","trees_url":"https://api.github.com/repos/abhitopia/nngraph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abhitopia/nngraph/statuses/{sha}","languages_url":"https://api.github.com/repos/abhitopia/nngraph/languages","stargazers_url":"https://api.github.com/repos/abhitopia/nngraph/stargazers","contributors_url":"https://api.github.com/repos/abhitopia/nngraph/contributors","subscribers_url":"https://api.github.com/repos/abhitopia/nngraph/subscribers","subscription_url":"https://api.github.com/repos/abhitopia/nngraph/subscription","commits_url":"https://api.github.com/repos/abhitopia/nngraph/commits{/sha}","git_commits_url":"https://api.github.com/repos/abhitopia/nngraph/git/commits{/sha}","comments_url":"https://api.github.com/repos/abhitopia/nngraph/comments{/number}","issue_comment_url":"https://api.github.com/repos/abhitopia/nngraph/issues/comments{/number}","contents_url":"https://api.github.com/repos/abhitopia/nngraph/contents/{+path}","compare_url":"https://api.github.com/repos/abhitopia/nngraph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abhitopia/nngraph/merges","archive_url":"https://api.github.com/repos/abhitopia/nngraph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abhitopia/nngraph/downloads","issues_url":"https://api.github.com/repos/abhitopia/nngraph/issues{/number}","pulls_url":"https://api.github.com/repos/abhitopia/nngraph/pulls{/number}","milestones_url":"https://api.github.com/repos/abhitopia/nngraph/milestones{/number}","notifications_url":"https://api.github.com/repos/abhitopia/nngraph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abhitopia/nngraph/labels{/name}","releases_url":"https://api.github.com/repos/abhitopia/nngraph/releases{/id}","deployments_url":"https://api.github.com/repos/abhitopia/nngraph/deployments","created_at":"2016-03-16T01:23:23Z","updated_at":"2016-03-16T01:23:23Z","pushed_at":"2016-03-16T01:45:39Z","git_url":"git://github.com/abhitopia/nngraph.git","ssh_url":"git@github.com:abhitopia/nngraph.git","clone_url":"https://github.com/abhitopia/nngraph.git","svn_url":"https://github.com/abhitopia/nngraph","homepage":null,"size":1888,"stargazers_count":0,"watchers_count":0,"language":"Lua","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":"torch:master","ref":"master","sha":"d0c239bdcfcd01d0ce77127136d20fc93767c1bf","user":{"login":"torch","id":4978924,"avatar_url":"https://avatars.githubusercontent.com/u/4978924?v=3","gravatar_id":"","url":"https://api.github.com/users/torch","html_url":"https://github.com/torch","followers_url":"https://api.github.com/users/torch/followers","following_url":"https://api.github.com/users/torch/following{/other_user}","gists_url":"https://api.github.com/users/torch/gists{/gist_id}","starred_url":"https://api.github.com/users/torch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torch/subscriptions","organizations_url":"https://api.github.com/users/torch/orgs","repos_url":"https://api.github.com/users/torch/repos","events_url":"https://api.github.com/users/torch/events{/privacy}","received_events_url":"https://api.github.com/users/torch/received_events","type":"Organization","site_admin":false},"repo":{"id":9166958,"name":"nngraph","full_name":"torch/nngraph","owner":{"login":"torch","id":4978924,"avatar_url":"https://avatars.githubusercontent.com/u/4978924?v=3","gravatar_id":"","url":"https://api.github.com/users/torch","html_url":"https://github.com/torch","followers_url":"https://api.github.com/users/torch/followers","following_url":"https://api.github.com/users/torch/following{/other_user}","gists_url":"https://api.github.com/users/torch/gists{/gist_id}","starred_url":"https://api.github.com/users/torch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torch/subscriptions","organizations_url":"https://api.github.com/users/torch/orgs","repos_url":"https://api.github.com/users/torch/repos","events_url":"https://api.github.com/users/torch/events{/privacy}","received_events_url":"https://api.github.com/users/torch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/torch/nngraph","description":"Graph Computation for nn","fork":false,"url":"https://api.github.com/repos/torch/nngraph","forks_url":"https://api.github.com/repos/torch/nngraph/forks","keys_url":"https://api.github.com/repos/torch/nngraph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torch/nngraph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torch/nngraph/teams","hooks_url":"https://api.github.com/repos/torch/nngraph/hooks","issue_events_url":"https://api.github.com/repos/torch/nngraph/issues/events{/number}","events_url":"https://api.github.com/repos/torch/nngraph/events","assignees_url":"https://api.github.com/repos/torch/nngraph/assignees{/user}","branches_url":"https://api.github.com/repos/torch/nngraph/branches{/branch}","tags_url":"https://api.github.com/repos/torch/nngraph/tags","blobs_url":"https://api.github.com/repos/torch/nngraph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torch/nngraph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torch/nngraph/git/refs{/sha}","trees_url":"https://api.github.com/repos/torch/nngraph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torch/nngraph/statuses/{sha}","languages_url":"https://api.github.com/repos/torch/nngraph/languages","stargazers_url":"https://api.github.com/repos/torch/nngraph/stargazers","contributors_url":"https://api.github.com/repos/torch/nngraph/contributors","subscribers_url":"https://api.github.com/repos/torch/nngraph/subscribers","subscription_url":"https://api.github.com/repos/torch/nngraph/subscription","commits_url":"https://api.github.com/repos/torch/nngraph/commits{/sha}","git_commits_url":"https://api.github.com/repos/torch/nngraph/git/commits{/sha}","comments_url":"https://api.github.com/repos/torch/nngraph/comments{/number}","issue_comment_url":"https://api.github.com/repos/torch/nngraph/issues/comments{/number}","contents_url":"https://api.github.com/repos/torch/nngraph/contents/{+path}","compare_url":"https://api.github.com/repos/torch/nngraph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torch/nngraph/merges","archive_url":"https://api.github.com/repos/torch/nngraph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torch/nngraph/downloads","issues_url":"https://api.github.com/repos/torch/nngraph/issues{/number}","pulls_url":"https://api.github.com/repos/torch/nngraph/pulls{/number}","milestones_url":"https://api.github.com/repos/torch/nngraph/milestones{/number}","notifications_url":"https://api.github.com/repos/torch/nngraph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torch/nngraph/labels{/name}","releases_url":"https://api.github.com/repos/torch/nngraph/releases{/id}","deployments_url":"https://api.github.com/repos/torch/nngraph/deployments","created_at":"2013-04-02T09:40:10Z","updated_at":"2016-04-28T06:17:23Z","pushed_at":"2016-04-28T05:21:09Z","git_url":"git://github.com/torch/nngraph.git","ssh_url":"git@github.com:torch/nngraph.git","clone_url":"https://github.com/torch/nngraph.git","svn_url":"https://github.com/torch/nngraph","homepage":null,"size":1962,"stargazers_count":126,"watchers_count":126,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":7,"forks":54,"open_issues":7,"watchers":126,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/torch/nngraph/pulls/108"},"html":{"href":"https://github.com/torch/nngraph/pull/108"},"issue":{"href":"https://api.github.com/repos/torch/nngraph/issues/108"},"comments":{"href":"https://api.github.com/repos/torch/nngraph/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/torch/nngraph/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/torch/nngraph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/torch/nngraph/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/torch/nngraph/statuses/d2316ef6bd519fc6b1e1230121ff026e38380086"}}}}