2 quantized_model = torch.quantization.quantize_dynamic( 3 zh_model, 4 {torch.nn.Linear}, 5 dtype=torch.qint8 6) 导出7 8 # ONNX 9 torch.onnx.export( 10 quantized_model, 11 (dummy_input,), 12 "t5_legal.onnx", 13
If you like what you see, support me in keeping the lights on to produce more posts like this. 🔗 Installation git clone https://github.com/dnth/yolov5-deepsparse-blogpost cd yolov5-deepsparse-blogpost/ pip install torch==1.9.0 torchvision==0.10.0 --extra-index-url https://download...