Providing a bool or integral fill_value without setting the optional dtype or out arguments...
The or ... value out Without arguments setting
2023-09-14 09:13:19 时间
1.报错
报错信息如下:
Providing a bool or integral fill_value without setting the optional dtype or out arguments is currently unsupported. In PyTorch 1.7, when dtype and out are not set a bool fill_value will return a tensor of torch.bool dtype, and an integral fill_value will return a tensor of torch.long dtype.
可以参考pytorch 的官方文档进行查看
原因
版本问题,导致错误。
修改案例
这里提供我个人的修改案例,供大家参考:
非常简单,只需要提供tensor返回的数据类型就可以了,而不用再在后面加.torch.long()
这种方式了
相关文章
- HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
- [Typescript] Tips: Create your own 'objectKeys' function using generics and the 'keyof' operator
- [Javascript] Link to Other Objects through the JavaScript Prototype Chain (Object.setPrototypeOf())
- The magic method __set() must have public visibility and cannot be static in
- Caused by: org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.
- Error: Connection lost: The server closed the connection
- Error: String or binary data would be truncated. The statement has been terminated
- 解决The type or namespace name 'XXXX' does not exist in the namespace 'XXXXXXXXX' 的错误
- how CRM One Order search by contact name work in the past
- why is the configuration.js being loaded?
- git push报错 fatal: The current branch master has no upstream branch. To push the current
- NLP:LSTM之父眼中的深度学习十年简史《The 2010s: Our Decade of Deep Learning / Outlook on the 2020s》的参考文献
- 成功解决ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
- 已解决Consider using the --user option or check the permissions.
- 【已解决】RuntimeError: The following handlers are available to decode the pixel data however they are
- The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar
- 内网渗透(三十七)之横向移动篇-Pass the Hash 哈希传递攻击(PTH)横向移动
- e606. Determining Which Component or Window Has the Focus
- MySQL----JDBC无法连接数据库,报The driver has not received any packets from the server的解决办法
- Linux|错误集锦|prometheus Error on ingesting samples that are too old or are too far into the future的解决