Bidirectional GRU and LSTM C++ API forward fix (#22850)
Summary:
Fixing https://github.com/pytorch/pytorch/issues/17998
Pull Request resolved: https://github.com/pytorch/pytorch/pull/22850
Differential Revision: D16420854
Pulled By: pbelevich
fbshipit-source-id: 76f38be40d8479fb9cafba92939cea61d81fd336