[Quant] Make quantizable LSTM scriptable (#83304)
Summary: Previously `torch.nn.quantizable.LSTM` was not scriptable
due to (1) the use of asterisk to unpack arguments, and (2) some
arguments being Optional, which was not understood by setitem.
This commit resolves both of these issues, enabling LSTM quantized
through custom modules to work with TorchScript.
Test Plan:
python test/test_quantization.py TestQuantizedOps.test_custom_module_lstm
Reviewers: jerryzh168, z-a-f
Subscribers: jerryzh168, z-a-f, supriyar
Tasks:
https://github.com/pytorch/pytorch/issues/83211
https://github.com/pytorch/pytorch/issues/75042
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83304
Approved by: https://github.com/jerryzh168