Revert "[hop] ban creating hop by directly instantiating HigherOrderOperator. (#133645)"

This reverts commit 696107efcb83f9359aa669ab343c2cfa2a111372.

Reverted https://github.com/pytorch/pytorch/pull/133645 on behalf of https://github.com/ydwu4 due to breaking ci. probably due to land race ([comment](https://github.com/pytorch/pytorch/pull/133645#issuecomment-2302866106))
This commit is contained in:
PyTorch MergeBot
2024-08-21 19:33:14 +00:00
parent 5fcfccefc6
commit 1491a61769
11 changed files with 11 additions and 68 deletions

View File

@ -4989,11 +4989,7 @@ def forward(self, x_1):
def construct_sum_pyop():
class MySum(HigherOrderOperator):
def __init__(self):
super().__init__("mysum")
mysum = MySum()
mysum = HigherOrderOperator("mysum")
@mysum.py_impl(torch._C._functorch.TransformType.Vmap)
def mysum_batch_rule(interpreter, x, dim):