That’s just not how LSTMs work - they use a linear layer (or two) under the hood and that won’t cope with varying feature size. You could, of course, manually reimplement LSTM (there also is one in the https://github/pytorch/benchmark 8 repository) and replace the linear with convolutions or so. I think this has been proposed somewhere in the literature. But all of this will leave the territory covered by PyTorch’s LSTM implementation.
Best regards
Thomas