mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[hop] ban creating hop by directly instantiating HigherOrderOperator. (#133645)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133645 Approved by: https://github.com/zou3519
This commit is contained in:
committed by
PyTorch MergeBot
parent
3546628a2a
commit
a23d86c178
@ -4989,7 +4989,11 @@ def forward(self, x_1):
|
||||
|
||||
|
||||
def construct_sum_pyop():
|
||||
mysum = HigherOrderOperator("mysum")
|
||||
class MySum(HigherOrderOperator):
|
||||
def __init__(self):
|
||||
super().__init__("mysum")
|
||||
|
||||
mysum = MySum()
|
||||
|
||||
@mysum.py_impl(torch._C._functorch.TransformType.Vmap)
|
||||
def mysum_batch_rule(interpreter, x, dim):
|
||||
|
||||
Reference in New Issue
Block a user