# 需要注意不要在終端中單行敲入運行如下代碼,要將如下代碼先拷貝到 *.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))