Skip to content

Commit 0a3961c

Browse files
MAXEE998houseroad
authored andcommitted
Update and Add links to the symbolic opset files (onnx#124)
Hi, The original link to symbolic.py is no longer working since now there are multiple files for definitions of symbolic operator functions. Perhaps providing the links to the helper file and to the new opset files is the best fix? I also add the link to torch/csrc/autograd/generated/VariableType.h, for the sake of convenience.
1 parent e5abb48 commit 0a3961c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tutorials/PytorchAddExportSupport.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ importer (such as onnx-caffe2) developers, as additional work is required.
2222
### How to add support to export an operator in PyTorch
2323
#### Condition 1: If the operator in PyTorch is an ATen operator...
2424
To determine whether the operator is an ATen operator or not, check
25-
`torch/csrc/autograd/generated/VariableType.h` (available within generated code in the PyTorch install dir). If you find the corresponding function in this header file, it's most likely an ATen operator.
25+
[`torch/csrc/autograd/generated/VariableType.h`](https://bddppq.github.io/codebrowser/pytorch/pytorch/torch/csrc/autograd/generated/VariableType.h) (available within generated code in the PyTorch install dir). If you find the corresponding function in this header file, it's most likely an ATen operator.
2626

2727
**Define symbolic functions.** In this case, you should obey the following rules.
28-
- Define the symbolic function in [`torch/onnx/symbolic.py`](https://github.com/pytorch/pytorch/blob/master/torch/onnx/symbolic.py). Make sure the
28+
- Define the symbolic function in [`torch/onnx/symbolic.py`](https://github.com/pytorch/pytorch/blob/master/torch/onnx/symbolic_helper.py). Make sure the
2929
function has the same name as the ATen operator/function defined in
30-
`VariableType.h`.
30+
[`VariableType.h`](https://bddppq.github.io/codebrowser/pytorch/pytorch/torch/csrc/autograd/generated/VariableType.h).
3131
- The first parameter is always the exported ONNX graph.
3232
- Parameter names must match the names in `VariableType.h` EXACTLY, because
3333
dispatch is done with keyword arguments.
@@ -138,7 +138,10 @@ getting it into ONNX proper, you can add your operator as an *experimental*
138138
operator.
139139

140140
## More ONNX symbolic examples
141-
- [ATen operators in symbolic.py](https://github.com/pytorch/pytorch/blob/master/torch/onnx/symbolic.py)
141+
- ATen operators in symbolic.py
142+
- [symbolic_opset10.py](https://github.com/pytorch/pytorch/blob/master/torch/onnx/symbolic_opset10.py)
143+
- [symbolic_opset9.py](https://github.com/pytorch/pytorch/blob/master/torch/onnx/symbolic_opset9.py)
144+
- [symbolic_helper.py](https://github.com/pytorch/pytorch/blob/master/torch/onnx/symbolic_helper.py)
142145
- [Index](https://github.com/pytorch/pytorch/blob/99037d627da68cdf53d3d0315deceddfadf03bba/torch/autograd/_functions/tensor.py#L24)
143146
- [Negate](https://github.com/pytorch/pytorch/blob/99037d627da68cdf53d3d0315deceddfadf03bba/torch/autograd/_functions/basic_ops.py#L50)
144147
- [ConstantPadNd](https://github.com/pytorch/pytorch/blob/99037d627da68cdf53d3d0315deceddfadf03bba/torch/nn/_functions/padding.py#L8)

0 commit comments

Comments
 (0)