[const_fold] Set requires_grad based on the folded tensor; add device_for_folding option (#79067)
Summary: att
Test Plan: Added unit test coverage for tensor_meta part.
Reviewed By: wushirong
Differential Revision: D36975932
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79067
Approved by: https://github.com/dborkovic