Element-Research / rnn

Recurrent Neural Network library for Torch7's nn
BSD 3-Clause "New" or "Revised" License
939 stars 313 forks source link

Actually support passing tables of LongStorage as output size #364

Closed nhynes closed 7 years ago

nhynes commented 7 years ago

According to the docs for Recurrence,

it needs to know the outputSize, which is either a number or torch.LongStorage, or table thereof

This is currently untrue as there is no case for it in recursiveResizeZero! This PR remedies this by treating a table of LongStorages as a table of tables.

Note that the initial check in __init guarantees that the only other input type to recursiveResizeZero is number, so checking that type(size) ~= 'number' is valid.

nicholas-leonard commented 7 years ago

@nhynes Thanks for fixing this :)