Skip to content

Conversation

justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented May 25, 2022

  • Remove wrappers in __init__ around utils and instead expose those functions directly. Move the docstrings from __init__ to corresponding functions in utils
  • Annotate torch.onnx.export types
  • Improve docstrings

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented May 25, 2022

🔗 Helpful links

✅ No Failures (0 Pending)

As of commit fed901d (more details on the Dr. CI page):

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@justinchuby justinchuby added module: onnx Related to torch.onnx module: docs Related to our documentation, both in docs/ and docblocks and removed cla signed labels May 25, 2022
@justinchuby justinchuby marked this pull request as ready for review May 25, 2022 02:08
@justinchuby justinchuby self-assigned this May 25, 2022
@justinchuby justinchuby removed their assignment May 25, 2022
@BowenBao
Copy link
Collaborator

A lot of CI failures, please take a look, maybe doc building is failing?

@justinchuby justinchuby linked an issue May 26, 2022 that may be closed by this pull request
@justinchuby justinchuby linked an issue Jun 7, 2022 that may be closed by this pull request
2 tasks
pytorchmergebot pushed a commit that referenced this pull request Jun 14, 2022
- Move definitions in `__init__` to internal classes and expose them by importing to init (prevent circular dependencies): https://github.com/pytorch/pytorch/wiki/torch.onnx-Namespacing
  - Context classes and enums are moved to `_exporter_states.py`
  - Exceptions are moved to `errors.py`
- Define `__all__` for torch.onnx. https://github.com/pytorch/pytorch/wiki/Public-API-definition-and-documentation
- Moved `utils.__IN_ONNX_EXPORT` to `GLOBALS.in_onnx_export`
- Deprecated `torch.onnx._export`

Precedes #78231

Using this as an aid for finding public functions:

```python
list(filter(lambda x: not x.startswith("_"), torch.onnx.utils.__dict__.keys()))
```
Pull Request resolved: #78446
Approved by: https://github.com/BowenBao
@justinchuby justinchuby marked this pull request as ready for review June 15, 2022 17:25
@justinchuby
Copy link
Collaborator Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

facebook-github-bot pushed a commit that referenced this pull request Jun 16, 2022
Summary:
- Move definitions in `__init__` to internal classes and expose them by importing to init (prevent circular dependencies): https://github.com/pytorch/pytorch/wiki/torch.onnx-Namespacing
  - Context classes and enums are moved to `_exporter_states.py`
  - Exceptions are moved to `errors.py`
- Define `__all__` for torch.onnx. https://github.com/pytorch/pytorch/wiki/Public-API-definition-and-documentation
- Moved `utils.__IN_ONNX_EXPORT` to `GLOBALS.in_onnx_export`
- Deprecated `torch.onnx._export`

Precedes #78231

Using this as an aid for finding public functions:

```python
list(filter(lambda x: not x.startswith("_"), torch.onnx.utils.__dict__.keys()))
```

Pull Request resolved: #78446
Approved by: https://github.com/BowenBao

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/d3ef5c3fa3ff677259a713b1b6533fa56e5f8ccc

Reviewed By: malfet

Differential Revision: D37156412

Pulled By: malfet

fbshipit-source-id: 2d13f24c6a1e2c5d2636087c117fb77424500d78
@github-actions
Copy link
Contributor

Hey @justinchuby.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@justinchuby justinchuby added release notes: onnx torch.onnx related changes that should show up in the release notes topic: improvements topic category labels Jun 16, 2022
facebook-github-bot pushed a commit that referenced this pull request Jun 20, 2022
Summary:
- Remove wrappers in `__init__` around utils and instead expose those functions directly. Move the docstrings from `__init__` to corresponding functions in utils
- Annotate `torch.onnx.export` types
- Improve docstrings

Pull Request resolved: #78231
Approved by: https://github.com/BowenBao

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/4b817f581640daf939fe9b195b1e8e7952c88203

Reviewed By: malfet

Differential Revision: D37242157

Pulled By: malfet

fbshipit-source-id: 24e8d55fc93a425a63f96deaa043963bad2e4984
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Jul 27, 2022
- Move definitions in `__init__` to internal classes and expose them by importing to init (prevent circular dependencies): https://github.com/pytorch/pytorch/wiki/torch.onnx-Namespacing
  - Context classes and enums are moved to `_exporter_states.py`
  - Exceptions are moved to `errors.py`
- Define `__all__` for torch.onnx. https://github.com/pytorch/pytorch/wiki/Public-API-definition-and-documentation
- Moved `utils.__IN_ONNX_EXPORT` to `GLOBALS.in_onnx_export`
- Deprecated `torch.onnx._export`

Precedes pytorch#78231

Using this as an aid for finding public functions:

```python
list(filter(lambda x: not x.startswith("_"), torch.onnx.utils.__dict__.keys()))
```
Pull Request resolved: pytorch#78446
Approved by: https://github.com/BowenBao
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Jul 27, 2022
- Remove wrappers in `__init__` around utils and instead expose those functions directly. Move the docstrings from `__init__` to corresponding functions in utils
- Annotate `torch.onnx.export` types
- Improve docstrings
Pull Request resolved: pytorch#78231
Approved by: https://github.com/BowenBao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged module: docs Related to our documentation, both in docs/ and docblocks module: onnx Related to torch.onnx open source release notes: onnx torch.onnx related changes that should show up in the release notes topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ONNX] Add __all__ to torch.onnx [ONNX] Use pytorch style docstrings in the onnx module

5 participants