{"action":"created","comment":{"url":"https://api.github.com/repos/torch/nn/pulls/comments/53554488","id":53554488,"diff_hunk":"@@ -8,11 +8,18 @@ function JoinTable:__init(dimension, nInputDims)\n    self.nInputDims = nInputDims\n end\n \n-function JoinTable:updateOutput(input)\n+function JoinTable:_getPositiveDimension(input)\n    local dimension = self.dimension\n-   if self.nInputDims and input[1]:dim()==(self.nInputDims+1) then\n-       dimension = dimension + 1\n+   if dimension < 0 then\n+      dimension = input:dim() + dimension + 1","path":"JoinTable.lua","position":10,"original_position":10,"commit_id":"8575d100a36df1d820942323650b5c10a74de574","original_commit_id":"8575d100a36df1d820942323650b5c10a74de574","user":{"login":"soumith","id":1310570,"avatar_url":"https://avatars.githubusercontent.com/u/1310570?v=3","gravatar_id":"","url":"https://api.github.com/users/soumith","html_url":"https://github.com/soumith","followers_url":"https://api.github.com/users/soumith/followers","following_url":"https://api.github.com/users/soumith/following{/other_user}","gists_url":"https://api.github.com/users/soumith/gists{/gist_id}","starred_url":"https://api.github.com/users/soumith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soumith/subscriptions","organizations_url":"https://api.github.com/users/soumith/orgs","repos_url":"https://api.github.com/users/soumith/repos","events_url":"https://api.github.com/users/soumith/events{/privacy}","received_events_url":"https://api.github.com/users/soumith/received_events","type":"User","site_admin":false},"body":"if the input is 4-dimensional, and i give dimension to be -1, then I'd expect it to join dim-3, but with this formulation, dimension will be 4. What am I missing here...","created_at":"2016-02-20T18:02:29Z","updated_at":"2016-02-20T18:02:29Z","html_url":"https://github.com/torch/nn/pull/656#discussion_r53554488","pull_request_url":"https://api.github.com/repos/torch/nn/pulls/656","_links":{"self":{"href":"https://api.github.com/repos/torch/nn/pulls/comments/53554488"},"html":{"href":"https://github.com/torch/nn/pull/656#discussion_r53554488"},"pull_request":{"href":"https://api.github.com/repos/torch/nn/pulls/656"}}},"pull_request":{"url":"https://api.github.com/repos/torch/nn/pulls/656","id":60053841,"html_url":"https://github.com/torch/nn/pull/656","diff_url":"https://github.com/torch/nn/pull/656.diff","patch_url":"https://github.com/torch/nn/pull/656.patch","issue_url":"https://api.github.com/repos/torch/nn/issues/656","number":656,"state":"open","locked":false,"title":"added support for negative dimensions to JoinTable","user":{"login":"CodeRect","id":1238034,"avatar_url":"https://avatars.githubusercontent.com/u/1238034?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeRect","html_url":"https://github.com/CodeRect","followers_url":"https://api.github.com/users/CodeRect/followers","following_url":"https://api.github.com/users/CodeRect/following{/other_user}","gists_url":"https://api.github.com/users/CodeRect/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeRect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeRect/subscriptions","organizations_url":"https://api.github.com/users/CodeRect/orgs","repos_url":"https://api.github.com/users/CodeRect/repos","events_url":"https://api.github.com/users/CodeRect/events{/privacy}","received_events_url":"https://api.github.com/users/CodeRect/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-20T17:10:55Z","updated_at":"2016-02-20T18:02:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"73e5553d96b44b1335fb044ef8ecaf58c9cc6009","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/torch/nn/pulls/656/commits","review_comments_url":"https://api.github.com/repos/torch/nn/pulls/656/comments","review_comment_url":"https://api.github.com/repos/torch/nn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/torch/nn/issues/656/comments","statuses_url":"https://api.github.com/repos/torch/nn/statuses/8575d100a36df1d820942323650b5c10a74de574","head":{"label":"CodeRect:patch-1","ref":"patch-1","sha":"8575d100a36df1d820942323650b5c10a74de574","user":{"login":"CodeRect","id":1238034,"avatar_url":"https://avatars.githubusercontent.com/u/1238034?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeRect","html_url":"https://github.com/CodeRect","followers_url":"https://api.github.com/users/CodeRect/followers","following_url":"https://api.github.com/users/CodeRect/following{/other_user}","gists_url":"https://api.github.com/users/CodeRect/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeRect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeRect/subscriptions","organizations_url":"https://api.github.com/users/CodeRect/orgs","repos_url":"https://api.github.com/users/CodeRect/repos","events_url":"https://api.github.com/users/CodeRect/events{/privacy}","received_events_url":"https://api.github.com/users/CodeRect/received_events","type":"User","site_admin":false},"repo":{"id":52164877,"name":"nn","full_name":"CodeRect/nn","owner":{"login":"CodeRect","id":1238034,"avatar_url":"https://avatars.githubusercontent.com/u/1238034?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeRect","html_url":"https://github.com/CodeRect","followers_url":"https://api.github.com/users/CodeRect/followers","following_url":"https://api.github.com/users/CodeRect/following{/other_user}","gists_url":"https://api.github.com/users/CodeRect/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeRect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeRect/subscriptions","organizations_url":"https://api.github.com/users/CodeRect/orgs","repos_url":"https://api.github.com/users/CodeRect/repos","events_url":"https://api.github.com/users/CodeRect/events{/privacy}","received_events_url":"https://api.github.com/users/CodeRect/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CodeRect/nn","description":"","fork":true,"url":"https://api.github.com/repos/CodeRect/nn","forks_url":"https://api.github.com/repos/CodeRect/nn/forks","keys_url":"https://api.github.com/repos/CodeRect/nn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodeRect/nn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodeRect/nn/teams","hooks_url":"https://api.github.com/repos/CodeRect/nn/hooks","issue_events_url":"https://api.github.com/repos/CodeRect/nn/issues/events{/number}","events_url":"https://api.github.com/repos/CodeRect/nn/events","assignees_url":"https://api.github.com/repos/CodeRect/nn/assignees{/user}","branches_url":"https://api.github.com/repos/CodeRect/nn/branches{/branch}","tags_url":"https://api.github.com/repos/CodeRect/nn/tags","blobs_url":"https://api.github.com/repos/CodeRect/nn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodeRect/nn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodeRect/nn/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodeRect/nn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodeRect/nn/statuses/{sha}","languages_url":"https://api.github.com/repos/CodeRect/nn/languages","stargazers_url":"https://api.github.com/repos/CodeRect/nn/stargazers","contributors_url":"https://api.github.com/repos/CodeRect/nn/contributors","subscribers_url":"https://api.github.com/repos/CodeRect/nn/subscribers","subscription_url":"https://api.github.com/repos/CodeRect/nn/subscription","commits_url":"https://api.github.com/repos/CodeRect/nn/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodeRect/nn/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodeRect/nn/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodeRect/nn/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodeRect/nn/contents/{+path}","compare_url":"https://api.github.com/repos/CodeRect/nn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodeRect/nn/merges","archive_url":"https://api.github.com/repos/CodeRect/nn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodeRect/nn/downloads","issues_url":"https://api.github.com/repos/CodeRect/nn/issues{/number}","pulls_url":"https://api.github.com/repos/CodeRect/nn/pulls{/number}","milestones_url":"https://api.github.com/repos/CodeRect/nn/milestones{/number}","notifications_url":"https://api.github.com/repos/CodeRect/nn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodeRect/nn/labels{/name}","releases_url":"https://api.github.com/repos/CodeRect/nn/releases{/id}","deployments_url":"https://api.github.com/repos/CodeRect/nn/deployments","created_at":"2016-02-20T17:09:05Z","updated_at":"2016-02-20T17:09:06Z","pushed_at":"2016-02-20T17:10:36Z","git_url":"git://github.com/CodeRect/nn.git","ssh_url":"git@github.com:CodeRect/nn.git","clone_url":"https://github.com/CodeRect/nn.git","svn_url":"https://github.com/CodeRect/nn","homepage":"","size":2392,"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":"0d4ae479755f0f1547c1e4bcddf8ea198bf50063","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":13677447,"name":"nn","full_name":"torch/nn","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/nn","description":"","fork":false,"url":"https://api.github.com/repos/torch/nn","forks_url":"https://api.github.com/repos/torch/nn/forks","keys_url":"https://api.github.com/repos/torch/nn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torch/nn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torch/nn/teams","hooks_url":"https://api.github.com/repos/torch/nn/hooks","issue_events_url":"https://api.github.com/repos/torch/nn/issues/events{/number}","events_url":"https://api.github.com/repos/torch/nn/events","assignees_url":"https://api.github.com/repos/torch/nn/assignees{/user}","branches_url":"https://api.github.com/repos/torch/nn/branches{/branch}","tags_url":"https://api.github.com/repos/torch/nn/tags","blobs_url":"https://api.github.com/repos/torch/nn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torch/nn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torch/nn/git/refs{/sha}","trees_url":"https://api.github.com/repos/torch/nn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torch/nn/statuses/{sha}","languages_url":"https://api.github.com/repos/torch/nn/languages","stargazers_url":"https://api.github.com/repos/torch/nn/stargazers","contributors_url":"https://api.github.com/repos/torch/nn/contributors","subscribers_url":"https://api.github.com/repos/torch/nn/subscribers","subscription_url":"https://api.github.com/repos/torch/nn/subscription","commits_url":"https://api.github.com/repos/torch/nn/commits{/sha}","git_commits_url":"https://api.github.com/repos/torch/nn/git/commits{/sha}","comments_url":"https://api.github.com/repos/torch/nn/comments{/number}","issue_comment_url":"https://api.github.com/repos/torch/nn/issues/comments{/number}","contents_url":"https://api.github.com/repos/torch/nn/contents/{+path}","compare_url":"https://api.github.com/repos/torch/nn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torch/nn/merges","archive_url":"https://api.github.com/repos/torch/nn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torch/nn/downloads","issues_url":"https://api.github.com/repos/torch/nn/issues{/number}","pulls_url":"https://api.github.com/repos/torch/nn/pulls{/number}","milestones_url":"https://api.github.com/repos/torch/nn/milestones{/number}","notifications_url":"https://api.github.com/repos/torch/nn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torch/nn/labels{/name}","releases_url":"https://api.github.com/repos/torch/nn/releases{/id}","deployments_url":"https://api.github.com/repos/torch/nn/deployments","created_at":"2013-10-18T12:27:25Z","updated_at":"2016-02-19T19:42:19Z","pushed_at":"2016-02-20T17:10:55Z","git_url":"git://github.com/torch/nn.git","ssh_url":"git@github.com:torch/nn.git","clone_url":"https://github.com/torch/nn.git","svn_url":"https://github.com/torch/nn","homepage":"","size":3436,"stargazers_count":433,"watchers_count":433,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":355,"mirror_url":null,"open_issues_count":44,"forks":355,"open_issues":44,"watchers":433,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/torch/nn/pulls/656"},"html":{"href":"https://github.com/torch/nn/pull/656"},"issue":{"href":"https://api.github.com/repos/torch/nn/issues/656"},"comments":{"href":"https://api.github.com/repos/torch/nn/issues/656/comments"},"review_comments":{"href":"https://api.github.com/repos/torch/nn/pulls/656/comments"},"review_comment":{"href":"https://api.github.com/repos/torch/nn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/torch/nn/pulls/656/commits"},"statuses":{"href":"https://api.github.com/repos/torch/nn/statuses/8575d100a36df1d820942323650b5c10a74de574"}}}}