Skip to content

Commit

Permalink
Update custom op API (pytorch#105947)
Browse files Browse the repository at this point in the history
As described in
https://docs.google.com/document/d/1aGWtgxV3HppuxQAdddyPrs74_aEntpkYt9MalnCKnhk/edit

This PR changes the CustomOp API to be private and adds new public
wrappers around it so that the user does not need to know about the
"CustomOp" object. We've effectively changed the "CustomOp" object to be
some metadata about the operator that the user does not directly
interact with.

The "updated custom op API" is in torch._custom_ops. Pending good customer
feedback, we will promote this module to torch.custom_ops.

NB: I cannot move around the older torch._custom_op APIs yet because
people are already using them.

Test Plan:
- I changed all of our tests to use the new `torch._custom_ops` module
instead of the old CustomOp API.
Pull Request resolved: pytorch#105947
Approved by: https://github.com/soulitzer
  • Loading branch information
zou3519 authored and pytorchmergebot committed Jul 28, 2023
1 parent 6d553a4 commit dad65d0
Show file tree
Hide file tree
Showing 4 changed files with 697 additions and 338 deletions.
Loading

0 comments on commit dad65d0

Please sign in to comment.