UserWarning: non-inplace resize is deprecated

警告:UserWarning: non-inplace resize is deprecated

原因: 弃用了resize_()

潜在危害: 可能导致累加变换的代码错误

解决办法: 改为reshape()

特别注意: a. reshape() 并不会改变a, 所以要a = a.reshape()

发布了70 篇原创文章 · 获赞 24 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/weixin_43914889/article/details/104655568