Change ATEN generator argument type to const std::optional<Generator>& (#6686)
Co-authored-by: cyy <cyyever@outlook.com>
Summary:
To adopt the changes in pytorch/pytorch#120076
To be noted, the original author is @cyyever and this is copied from #6595
Test Plan:
CI