So after about 8 months of wishing I could use VMap to stack LSTMs, I’ve finally found this: LSTM — torchrl main documentation
On this page, I see: “This class is implemented without relying on CuDNN, which makes it compatible with torch.vmap()”, which is great for me. However, when following the instructions on that page, I run into an error at the very first step, the import:
from torchrl.modules.tensordict_module.rnn import LSTM
That line produces this error:
ImportError: cannot import name 'LSTM' from 'torchrl.modules.tensordict_module.rnn' (/home/username/miniconda3/envs/envname/lib/python3.8/site-packages/torchrl/modules/tensordict_module/rnn.py)
Versioning info for context:
>>> import torch
>>> torch.__version__
>>> '2.1.1'
>>> import torchrl
>>> torchrl.__version__
>>> '0.2.1'
And python itself is 3.8.18.
TorchRL was installed via:
pip install torchrl
as per instructions on this page: Introduction to TorchRL — torchrl main documentation
Any takers on this? Frustrating error because I’ve been waiting for a way to stack LSTMs for almost a year now, and I finally find this torchrl LSTM that can supposedly be VMapped, seemingly follow usage instructions exactly, and can’t get past the import step.
Mega thanks to anyone that can help with this (: