Revert "Change ATEN generator argument type to const std::optional<Generator>& (#120076)"

This reverts commit 4305c64fea154ee1ab566e19bd7568753fc30916.

Reverted https://github.com/pytorch/pytorch/pull/120076 on behalf of https://github.com/izaitsevfb due to breaking internal builds(take 3) ([comment](https://github.com/pytorch/pytorch/pull/120076#issuecomment-1986338164))
This commit is contained in:
PyTorch MergeBot
2024-03-08 20:01:03 +00:00
parent c78f72d7e7
commit c0996866f4
49 changed files with 322 additions and 337 deletions

View File

@ -16,7 +16,6 @@ from torchgen.api.translate import translate
from torchgen.api.types import (
BaseCType,
Binding,
ConstRefCType,
deviceT,
DispatcherSignature,
kernel_signature,
@ -246,9 +245,7 @@ class GenLazyIR(ABC):
value_args = schema.filtered_args(values=True, scalars=False)
scalar_args = schema.filtered_args(values=False, scalars=True)
ctor_args = [
f"{ConstRefCType(i.lazy_type).cpp_type()} {i.name}" for i in all_args
]
ctor_args = [f"const {i.lazy_type.cpp_type()}& {i.name}" for i in all_args]
reuse_ctor_args = ", ".join(ctor_args)
if self.use_lazy_shape and schema.properties.ShapePrecompute:
ctor_args.append("std::vector<torch::lazy::Shape>&& shapes")