{"action":"created","issue":{"url":"https://api.github.com/repos/twitter/torch-autograd/issues/12","labels_url":"https://api.github.com/repos/twitter/torch-autograd/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/twitter/torch-autograd/issues/12/comments","events_url":"https://api.github.com/repos/twitter/torch-autograd/issues/12/events","html_url":"https://github.com/twitter/torch-autograd/pull/12","id":115696996,"number":12,"title":"Add AutoModule and AutoCriterion (build any nn.Module and nn.Criterio…","user":{"login":"nkoumchatzky","id":6900572,"avatar_url":"https://avatars.githubusercontent.com/u/6900572?v=3","gravatar_id":"","url":"https://api.github.com/users/nkoumchatzky","html_url":"https://github.com/nkoumchatzky","followers_url":"https://api.github.com/users/nkoumchatzky/followers","following_url":"https://api.github.com/users/nkoumchatzky/following{/other_user}","gists_url":"https://api.github.com/users/nkoumchatzky/gists{/gist_id}","starred_url":"https://api.github.com/users/nkoumchatzky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkoumchatzky/subscriptions","organizations_url":"https://api.github.com/users/nkoumchatzky/orgs","repos_url":"https://api.github.com/users/nkoumchatzky/repos","events_url":"https://api.github.com/users/nkoumchatzky/events{/privacy}","received_events_url":"https://api.github.com/users/nkoumchatzky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2015-11-07T22:40:07Z","updated_at":"2015-11-10T00:04:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/twitter/torch-autograd/pulls/12","html_url":"https://github.com/twitter/torch-autograd/pull/12","diff_url":"https://github.com/twitter/torch-autograd/pull/12.diff","patch_url":"https://github.com/twitter/torch-autograd/pull/12.patch"},"body":"This patch enables AutoModule definition from any forward function with the specified format, even with non-scalar outputs. This required to separate the grad(...) function in two parts. All tests pass, benchmarks are similar, so this shouldn't impact the current state. This should enable easy adoption for people who have nn/nngraph code embedded into another package and need the nn API. \r\n\r\n```\r\nBenchmark:\r\n-- Before\r\nlstm (ag+nn) =>  nn:  0.94s, autograd:  1.87s, ratio:  1.99x\r\nmlp (ag, batched) =>  nn:  0.28s, autograd:  0.70s, ratio:  2.53x\r\nlstm (ag+nn, batched) =>  nn:  2.21s, autograd:  5.58s, ratio:  2.52x\r\nlogistic (ag) =>  nn:  0.96s, autograd:  2.76s, ratio:  2.88x\r\ncnn (nnWrap, batched) =>  nn:  1.36s, autograd:  1.40s, ratio:  1.03x\r\nmlp (ag) =>  nn:  0.39s, autograd:  1.09s, ratio:  2.79x\r\nmlp (nn+ag) =>  nn:  0.38s, autograd:  0.52s, ratio:  1.37x\r\ncnn (nn, batched) =>  nn:  1.36s, autograd:  1.60s, ratio:  1.17x\r\nmlp (nn, batched) =>  nn:  0.27s, autograd:  0.44s, ratio:  1.60x\r\nmlp (nn) =>  nn:  0.44s, autograd:  0.48s, ratio:  1.10x\r\nlogistic (nn) =>  nn:  0.79s, autograd:  1.34s, ratio:  1.70x\r\nmlp (ag, fprop) =>  nn:  1.68s, autograd:  1.93s, ratio:  1.15x\r\n\r\n-- New\r\nlstm (ag+nn) =>  nn:  0.96s, autograd:  1.94s, ratio:  2.03x\r\nmlp (ag, batched) =>  nn:  0.28s, autograd:  0.70s, ratio:  2.51x\r\nlstm (ag+nn, batched) =>  nn:  2.21s, autograd:  5.08s, ratio:  2.30x\r\nlogistic (ag) =>  nn:  0.96s, autograd:  2.84s, ratio:  2.95x\r\ncnn (nnWrap, batched) =>  nn:  1.37s, autograd:  1.38s, ratio:  1.01x\r\nmlp (ag) =>  nn:  0.40s, autograd:  1.09s, ratio:  2.72x\r\nmlp (nn+ag) =>  nn:  0.39s, autograd:  0.53s, ratio:  1.35x\r\ncnn (nn, batched) =>  nn:  1.36s, autograd:  1.66s, ratio:  1.22x\r\nmlp (nn, batched) =>  nn:  0.30s, autograd:  0.43s, ratio:  1.44x\r\nmlp (nn) =>  nn:  0.43s, autograd:  0.50s, ratio:  1.16x\r\nlogistic (nn) =>  nn:  0.78s, autograd:  1.43s, ratio:  1.82x\r\nmlp (ag, fprop) =>  nn:  1.67s, autograd:  1.95s, ratio:  1.16x\r\n```"},"comment":{"url":"https://api.github.com/repos/twitter/torch-autograd/issues/comments/155238869","html_url":"https://github.com/twitter/torch-autograd/pull/12#issuecomment-155238869","issue_url":"https://api.github.com/repos/twitter/torch-autograd/issues/12","id":155238869,"user":{"login":"nkoumchatzky","id":6900572,"avatar_url":"https://avatars.githubusercontent.com/u/6900572?v=3","gravatar_id":"","url":"https://api.github.com/users/nkoumchatzky","html_url":"https://github.com/nkoumchatzky","followers_url":"https://api.github.com/users/nkoumchatzky/followers","following_url":"https://api.github.com/users/nkoumchatzky/following{/other_user}","gists_url":"https://api.github.com/users/nkoumchatzky/gists{/gist_id}","starred_url":"https://api.github.com/users/nkoumchatzky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkoumchatzky/subscriptions","organizations_url":"https://api.github.com/users/nkoumchatzky/orgs","repos_url":"https://api.github.com/users/nkoumchatzky/repos","events_url":"https://api.github.com/users/nkoumchatzky/events{/privacy}","received_events_url":"https://api.github.com/users/nkoumchatzky/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T00:04:23Z","updated_at":"2015-11-10T00:04:23Z","body":"Added doc to README."}}