Instructions to use CatSnowdrop/universal_onnxruntime with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TensorRT
How to use CatSnowdrop/universal_onnxruntime with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download onnxruntime/quantization/operators/resize.py from CatSnowdrop/universal_onnxruntime: direct link, hf CLI and curl.
- Browser
- Download file 928 Bytes
-
https://huggingface.co/CatSnowdrop/universal_onnxruntime/resolve/main/onnxruntime/quantization/operators/resize.py
- Command line
-
hf download hf://CatSnowdrop/universal_onnxruntime/onnxruntime/quantization/operators/resize.py
-
curl -L -o resize.py https://huggingface.co/CatSnowdrop/universal_onnxruntime/resolve/main/onnxruntime/quantization/operators/resize.py
928 Bytes
| from .direct_q8 import Direct8BitOp, QDQDirect8BitOp | |
| class QResize(Direct8BitOp): | |
| def __init__(self, onnx_quantizer, onnx_node): | |
| super().__init__(onnx_quantizer, onnx_node) | |
| def quantize(self): | |
| node = self.node | |
| assert node.op_type == "Resize" | |
| # if version is less than 11, go to normal quantize. | |
| if self.quantizer.opset_version < 11: | |
| super(Direct8BitOp, self).quantize() | |
| return | |
| # Direct 8bits op | |
| return super().quantize() | |
| class QDQResize(QDQDirect8BitOp): | |
| def __init__(self, onnx_quantizer, onnx_node): | |
| super().__init__(onnx_quantizer, onnx_node) | |
| def quantize(self): | |
| node = self.node | |
| assert node.op_type == "Resize" | |
| # if version is less than 11, just keep this node | |
| if self.quantizer.opset_version < 11: | |
| return | |
| # Direct 8bits op | |
| return super().quantize() | |