[reland] Allow setting grad_dtype on leaf tensors (#164751)

ghstack-source-id: e44b3941530be83a630ec93f1478eec741ffca2e
Pull-Request-resolved: https://github.com/pytorch/pytorch/pull/162815

Fixes #ISSUE_NUMBER

Relanding due to internal weirdness. Separate PR to codev w/o ghstack.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164751
Approved by: https://github.com/albanD
This commit is contained in:
soulitzer
2025-10-08 20:23:13 +00:00
committed by PyTorch MergeBot
parent 001e1d2637
commit 71aefd5595
20 changed files with 377 additions and 41 deletions

View File

@ -68,6 +68,8 @@ jit_core_sources = [
# list for the shared files.
core_sources_common = [
# This needs to belong here because it defines the first non-inline virtual
# function, which matters for AutogradMetaInterface's vtable.
"torch/csrc/autograd/autograd_meta.cpp",
"torch/csrc/autograd/forward_grad.cpp",
"torch/csrc/jit/frontend/edit_distance.cpp",