Fix complex to real casting warning in _to_copy backward
Fixes #75781
A Real->Complex cast should result in a gradient with no imaginary
component, so discarding the imaginary component is expected.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75805
Approved by: https://github.com/albanD