Skip to content

Commit 5b19816

Browse files
container doc
1 parent 3c4f8c5 commit 5b19816

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

doc/containers.md

+25-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
11
<a name="nn.Containers"/>
22
# Containers #
33
Complex neural networks are easily built using container classes:
4-
* [Sequential](#nn.Sequential) : plugs layers in a feed-forward fully connected manner ;
5-
* [Parallel](#nn.Parallel) : applies its `ith` child module to the `ith` slice of the input Tensor ;
6-
* [Concat](#nn.Concat) : concatenates in one layer several modules along dimension `dim` ;
7-
* [DepthConcat](#nn.DepthConcat) : like Concat, but adds zero-padding when non-`dim` sizes don't match;
4+
* [Container](#nn.Container) : abstract class inherited by containers ;
5+
* [Sequential](#nn.Sequential) : plugs layers in a feed-forward fully connected manner ;
6+
* [Parallel](#nn.Parallel) : applies its `ith` child module to the `ith` slice of the input Tensor ;
7+
* [Concat](#nn.Concat) : concatenates in one layer several modules along dimension `dim` ;
8+
* [DepthConcat](#nn.DepthConcat) : like Concat, but adds zero-padding when non-`dim` sizes don't match;
89

910
See also the [Table Containers](#nn.TableContainers) for manipulating tables of [Tensors](https://github.com/torch/torch7/blob/master/doc/tensor.md).
1011

12+
<a name="nn.Container"/>
13+
## Container ##
14+
15+
This is an abstract [Module](module.md#nn.Module) class which declares methods defined in all containers.
16+
It reimplements many of the Module methods such that calls are propagated to the
17+
contained modules. For example, a call to [zeroGradParameters](module.md#nn.Module.zeroGradParameters)
18+
will be propagated to all contained modules.
19+
20+
<a name="nn.Container.add"/>
21+
### add(module) ###
22+
Adds the given `module` to the container. The order is important
23+
24+
<a name="nn.Container.get"/>
25+
### get(index) ###
26+
Returns the contained modules at index `index`.
27+
28+
<a name="nn.Container.size"/>
29+
### size() ###
30+
Returns the number of contained modules.
31+
1132
<a name="nn.Sequential"/>
1233
## Sequential ##
1334

0 commit comments

Comments
 (0)