Probably a Pytorch version mismatch,first try updating first
Cuz If I remember correctly the codeline
Torch.get_autocast_dtype is likely from Pytorch version 1.11 or higher