[quant] Add embeddingbag_prepack function that works on quantized tensor. (#42762)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42762
Use a prepack function that accepts qtensor as an input. The output is a byte tensor with packed data.
This is currently implemented only for 8-bit. In the future once we add 4-bit support this function will be extended to support that too.
Note -In the following change I will add TorchBind support for this to support serialization of packed weights.
Test Plan:
python test/test_quantization.py TestQuantizedEmbeddingBag
Imported from OSS
Reviewed By: vkuzo
Differential Revision: D23070632
fbshipit-source-id: 502aa1302dffec1298cdf52832c9e2e5b69e44a8