There is the following issue on this page: https://docs.pytorch.org/tutorials/beginner/basics/tensorqs_tutorial.html
if torch.cuda.is_available():
tensor = tensor.to(torch.accelerator.current_accelerator()) has a problem that module 'torch' has no attribute 'accelerator'