xref: /aosp_15_r20/external/pytorch/tools/onnx/gen_diagnostics.sh (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1#!/bin/bash
2# Run this script inside its folder to generate PyTorch ONNX Export Diagnostic rules
3# for C++, Python and documentations.
4# The rules are defined in torch/onnx/_internal/diagnostics/rules.yaml.
5
6set -e -x
7ROOT="${PWD}/../../"
8pushd "$ROOT"
9(
10python -m tools.onnx.gen_diagnostics \
11    torch/onnx/_internal/diagnostics/rules.yaml \
12    torch/onnx/_internal/diagnostics \
13    torch/csrc/onnx/diagnostics/generated \
14    torch/docs/source
15)
16popd
17