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

This reverts commit ecbe82b9cec75324b7efb58e1d9cae6b35b71bdc.

Reverted https://github.com/pytorch/pytorch/pull/120076 on behalf of https://github.com/jeanschmidt due to Reverting in order to check if this will fix XLA trunk jobs ([comment](https://github.com/pytorch/pytorch/pull/120076#issuecomment-2015272644))
This commit is contained in:
PyTorch MergeBot
2024-03-22 14:53:45 +00:00
parent e6986e4317
commit 02fee6caec
47 changed files with 320 additions and 335 deletions

View File

@ -33,15 +33,15 @@ struct TestCPUGenerator : public c10::GeneratorImpl {
uint64_t value_;
};
Tensor& random_(Tensor& self, const std::optional<Generator>& generator) {
Tensor& random_(Tensor& self, c10::optional<Generator> generator) {
return at::native::templates::random_impl<native::templates::cpu::RandomKernel, TestCPUGenerator>(self, generator);
}
Tensor& random_from_to(Tensor& self, int64_t from, optional<int64_t> to, const std::optional<Generator>& generator) {
Tensor& random_from_to(Tensor& self, int64_t from, optional<int64_t> to, c10::optional<Generator> generator) {
return at::native::templates::random_from_to_impl<native::templates::cpu::RandomFromToKernel, TestCPUGenerator>(self, from, to, generator);
}
Tensor& random_to(Tensor& self, int64_t to, const std::optional<Generator>& generator) {
Tensor& random_to(Tensor& self, int64_t to, c10::optional<Generator> generator) {
return random_from_to(self, 0, to, generator);
}