Check if rnn weights need to be flattened (#34265)
Summary:
cuDNN needs it, MIOpen doesn't. However, since it seems to be the PyTorch preference to not introduce ROCm-specific logic in the python layer, we need to add a C++ function to detect if rnn weight flattening is needed.
This PR will be needed to fix the rnn unit test errors arising for PR https://github.com/pytorch/pytorch/issues/33837.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34265
Differential Revision: D20345105
Pulled By: ezyang
fbshipit-source-id: a2588a6e2ac6f7d1edf2b7872bc6a879a7df96ec