We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
文章代码运行错误,(第三段代码) x = V(t.arange(-2,4),requires_grad = True). 运行时出现“only Tensor of floating point type can require grad.”错误
x = V(t.arange(-2,4),requires_grad = True)
The text was updated successfully, but these errors were encountered:
改成t.arange(-2,4).float()就可以了 老版本的pytorch用arange创建默认是FloatTensor类型的 新版本arange创建时dtype默认是LongTensor
Sorry, something went wrong.
No branches or pull requests
文章代码运行错误,(第三段代码)
x = V(t.arange(-2,4),requires_grad = True)
.运行时出现“only Tensor of floating point type can require grad.”错误
The text was updated successfully, but these errors were encountered: