添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Why does the following code raise a runtime error, and what does that error mean?

permute(), it is also possible to create non-contiguous tensors:

reshape() method instead of view() to avoid the inconsistency between tensor shape and stride.

contiguous() method:

reshape() method is essentially a convenience method: It first checks whether a tensor is contiguous and then either returns a view (if it is) or converts the tensor into a contiguous copy by calling contiguous().