mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
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:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user