I am using Pytorch. I got this RuntimeError while evaluating a model. Any idea how to solve this?
SOLUTION: Just replace the view() function with reshape() function as suggested in the error and it works.
I guess this has to do with how the tensor is stored in memory.
SOLUTION2: change the .view(...)
to .contiguous().view(...)
.
Actually, 'reshape()' does a similar job as contiguous() under the hood, if it needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With