Revert "Add back private function torch.cuda.amp.autocast_mode._cast (#127433)"

This reverts commit 6e0eeecc7cd4dc389683e35d1f2e34738e09e597.

Reverted https://github.com/pytorch/pytorch/pull/127433 on behalf of https://github.com/fbgheith due to depends on https://github.com/pytorch/pytorch/pull/126898 which is failing internally and needs to be reverted ([comment](https://github.com/pytorch/pytorch/pull/127433#issuecomment-2142869610))
diff --git a/torch/cuda/amp/autocast_mode.py b/torch/cuda/amp/autocast_mode.py
index 09a44f5..e50206c 100644
--- a/torch/cuda/amp/autocast_mode.py
+++ b/torch/cuda/amp/autocast_mode.py
@@ -50,11 +50,6 @@
         return super().__call__(func)
 
 
-# Preserved only for BC reasons
-def _cast(value, dtype):
-    return torch.amp.autocast_mode._cast(value, "cuda", dtype)
-
-
 @deprecated(
     "`torch.cuda.amp.custom_fwd(args...)` is deprecated. "
     "Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.",