[quant] Enable jit tracing on quantizable LSTM (resubmission) (#64638)
authorZafar Takhirov <zaf@fb.com>
Wed, 8 Sep 2021 20:32:29 +0000 (13:32 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 8 Sep 2021 20:34:18 +0000 (13:34 -0700)
commit24e1315d4b0b4d064472868afe8ae492e25887b8
treeab16169769280b9feceadbaef24cf2f4103cd3d8
parentd701357d921ef167d42c125e65b6f7da6be3ad0f
[quant] Enable jit tracing on quantizable LSTM (resubmission) (#64638)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64638

The quantizable LSTM didn't support jit tracing because it had several non taceable paths. We sacrifice some of the user experience to enable the tracing.
The main UX feature removed is a user-friendly message when trying to access the backwards path in a bidirectional LSTM: When the bidirectional flag is False, we used to throw a nice error message when the user tried accessing backwards weights. Now the message is default (removed properties).

Test Plan: `buck test mode/dev //caffe2/test:quantization -- test_custom_module_lstm`

Reviewed By: HDCharles

Differential Revision: D30803753

fbshipit-source-id: a639955a96cee22538d9436f1c952a5d121f50f9
test/quantization/core/test_quantized_op.py
torch/nn/quantizable/modules/rnn.py