Obtaining the Source Code and Its Patch
Obtain the ONNX Runtime source code file from the ONNX Runtime official website and the ONNX Runtime operator optimization patch file from the Gitee repository.
Obtaining the ONNX Runtime Source Code
- Go to the /path/to/ONNX_Runtime directory.
1cd /path/to/ONNX_Runtime
- Configure a network proxy for Git.
1 2 3
git config --global http.sslVerify false git config --global https.sslVerify false git config --global http.proxy "http://Username:Password@Proxy_IP_address:Proxy_port"
- Obtain the ONNX_Runtime source code by following instructions in Table 2.
If the server is connected to the Internet, you can run the wget command on the server to download the source package.
cd /path/to/ONNX_Runtime wget https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.19.2.zip --no-check-certificate
- Copy the source code to the /path/to/ONNX_Runtime directory on the server.
- Decompress the ONNX Runtime installation package.
1unzip v1.19.2.zipThe onnxruntime-1.19.2 package is obtained.

- Go to the /path/to/ONNX_Runtime/onnxruntime-1.19.2 directory.
cd /path/to/ONNX_Runtime/onnxruntime-1.19.2
- Install Python dependencies.
1pip install -r requirements.txt --user
If the following issue occurs during the installation, set a mirror repository for installation.

pip install -r requirements.txt --user -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com/pypi/simple/
Obtaining and Applying the Source Code Patch
- Obtain the patch file of ONNX Runtime.
- Download the ONNX Runtime patch file konnx.patch by following instructions in Table 2.
- Upload the konnx.patch patch file to the /path/to/ONNX_Runtime directory.
- Go to the /path/to/ONNX_Runtime directory.
1cd /path/to/ONNX_Runtime/
- Rename onnxruntime-1.19.2 as sra_onnxruntime_adapter.
mv onnxruntime-1.19.2 sra_onnxruntime_adapter
- Initialize the repository.
1 2 3
git init git add . git commit -m "code init"
- Apply the softmax.patch patch file to the repository.
1git apply ../konnx.patch
- Check whether the files are modified as shown in the following figure. If yes, the patch is successfully installed.
1 2
git add . git status
