updated ConcatTable so that it works with table inputs as well as tensors

OK, so this one might not be popular.  I see no reason why ConcatTable should fail when the input is a table...  The documentation does say:

"ConcatTable is a container module that applies each member module to the same input Tensor."

However, it's a pretty trivial code change to allow table inputs as well.  I've found lots of applications where I've run into this limitation.

The commit below is pretty simple and I added a unit test for concat table for all code branches.  Please let me know what you think.

FYI: I'm happy to get rid of the assert calls if you think the string comparison is too expensive.
Oh damn it.  Yes, I forgot to remove that last line.


On Tue, Jul 8, 2014 at 1:42 PM, Nicholas Léonard <notifications@github.com>
wrote:

> In test/test.lua:
>
> > +
> > +   concat = nn.ConcatTable()
> > +   concat:add(nn.JoinTable(1))
> > +
> > +   m:add(concat)
> > +   m:add(nn.JoinTable(1))
> > +
> > +   err = jac.testJacobian(m, input)
> > +   mytester:assertlt(err, precision, ' error on state ')
> > +
> > +   ferr, berr = jac.testIO(m, input)
> > +   mytester:asserteq(ferr, 0, torch.typename(m)..' - i/o forward err ')
> > +   mytester:asserteq(berr, 0, torch.typename(m)..' - i/o backward err ')
> > +end
> > +
> > +nntest = {nntest.ConcatTable}
>
> this should be removed in the final version
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/torch/nn/pull/28/files#r14668207>.
>