Commit Graph

4 Commits

Author SHA1 Message Date
HAOCHENYE
9642a7c2f6 [ONNX] Fix get wrong summary of the docstring in torch.onnx._deprecation.deprecated (#87194)
The summary of the deprecated function could be multi-line. Therefore the code below:
9ac2a06acf/torch/onnx/_deprecation.py (L45)
should be adjusted to

```python
summary_and_body = docstring.split("\n\n", 1)
```
Otherwise, the multi-line summary will be separated wrongly.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87194
Approved by: https://github.com/justinchuby, https://github.com/BowenBao
2022-10-31 03:00:30 +00:00
Justin Chu
85a79a7f50 [ONNX] Expand _cast_ symbolic functions (#87666)
The `_cast_` family of symbolic functions has been created from a template function. Even though it saved some lines, it very much obscured the intention of the code. Since the list doesn't really change and the `_cast_` family are IIRC deprecated, it is safe for us to expand the templates and make the code more readable.

This PR also removes any direct calls to `_cast_` functions to maintain a consistent pattern of directly creating `Cast` nodes.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87666
Approved by: https://github.com/BowenBao
2022-10-26 00:39:59 +00:00
Justin Chu
69b927701a [ONNX] Update user documentation (#85819)
- Remove mentions of `SymbolicContext` in the doc
- Comment out the PythonOp example so that it is not shown to users
- Updated code blocks and wording
- Changed to recommend using `pip` for installing onnx.

Now adds a deprecation message to the docs (demo only):

![image](https://user-images.githubusercontent.com/11205048/193327649-f789b369-6b59-49e0-8bba-34a6785eb128.png)

Fixes #85608

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85819
Approved by: https://github.com/AllenTiTaiWang, https://github.com/BowenBao
2022-09-30 19:35:34 +00:00
Justin Chu
74c6a754a5 [ONNX] Deprecation utility (#81901)
Create a deprecation decorator that notifies user when a function is deprecated.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/81901
Approved by: https://github.com/kit1980
2022-07-22 15:19:19 +00:00