python運行報錯:
view size is not compatible with input tensor's size and stride (at least one dimension spans acros
出現(xiàn)這個原因主要就是因為view()需要Tensor中的元素地址是連續(xù)的,因為可能出現(xiàn)Tensor不連續(xù)的情況,修改為:在.view前加.contiguous(),使其變?yōu)檫B續(xù)就ok。
?文章來源:http://www.zghlxwxcb.cn/news/detail-508663.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-508663.html
到了這里,關(guān)于運行錯誤:view size is not compatible with input tensor‘s size and stride (at least的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!