torch/nn — pull request #28 by jonathantompson (2014-07-08 15:48:14+00:00)
Title: 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.