# 需要注意不要在终端中单行敲入运行如下代码,要将如下代码先拷贝到 *.py 文件中,再在终端命令中通过 python *.py 运行
import torch
if torch.cuda.is_available():
print("gpu cuda is available!")
torch.cuda.manual_seed(1000)
else:
print("cuda is not available! cpu is available!")
torch.manual_seed(1000)
print(torch.rand(1, 2))