Many times after using a view or transpose function we need to manually apply the .contiguous() to make the tensor contiguous for further operations.
Usually I get to know about this after getting an error saying make it contiguous.
Is there any tip when to use contiguous option, it’s a bit irritating to wait for errors. Also I have seen that it changed between pytorch version. A code that works in pytorch 0.4 didnt work with pytorch .3 until I used the contiguous option.
Hi, can’t reproduce error again sorry. But it comes a lot after reshape, squeeze and transpose operations.
Link to a Past Question I asked when I faced that error. Although I can’t reproduce it again , probably that error occurred in my model after alot of operations and (possibly) combined effect on them.