Commit Graph

112 Commits

Author SHA1 Message Date
Sam Gross
f5a6a3b0e9 Fix torch.nn.Module._apply with None types (#66) 2016-09-28 19:31:07 -04:00
Adam Paszke
7f4ff0e615 Fix type conversions in nn 2016-09-27 15:45:49 -07:00
Adam Paszke
f9d25e8e72 Refactor nn (require specifying parameters explicitly) 2016-09-27 15:22:26 -07:00
Sam Gross
44481354fc Add back support for child=None in Container constructor (#55)
It's often useful to have optional child modules, such as the
downsampling operation in ResNets. Add a test for this case:

  nn.Container(
    child=None,
  )
2016-09-26 17:18:02 -04:00
Adam Paszke
4cdeae3283 Return only unique variables from parameters() 2016-09-25 12:23:43 -07:00
Soumith Chintala
b5f7720ab9 docstrings for container and batchnorm 2016-09-16 05:31:36 -04:00
Sam Gross
b738b09606 Clean up Module forward and __call__ (#14)
* _forward is renamed forward since users should override it

 * some __call__ overrides are changed to forward

 * function which return a single variable are changed to return that
   variable instead of a one-element tuple
2016-09-07 15:41:39 -04:00
Sam Gross
f45213a276 Simplify nn.Container and nn.Sequential
- nn.Container.modules is just a python list and used by nn.Sequential

 - Every module in nn.Sequential has a name. This fixes Module.type()

 - nn.Sequential constructor accepts either a list or an OrderedDict. With a
   list, the modules are named "0", "1", "2", ...
2016-08-31 11:15:31 -07:00
Adam Paszke
ea93fb7ac0 Add more nn modules 2016-08-23 19:15:21 -07:00
Adam Paszke
7bcb2a4081 Initial optim version 2016-08-23 19:03:30 -07:00
Adam Paszke
2bf68e72d5 Add hook system to autograd and nn 2016-08-23 13:51:34 -07:00
Adam Paszke
e055ffbdc7 Add nn 2016-08-19 14:56:55 -07:00