RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
输入Tensor的维度出现问题。view需要tensor在子空间(地址)连续,根据提示有两种解决方法
1.修改离散型为连续型: 在.view前加.contiguous(),参考这个博主的https://blog.youkuaiyun.com/m0_52347246/article/details/120176728
2.使用reshape代替: