I have located the line of code that caused this warning, but I do not know how to fix it. I have tried the solutions provided by others, which is to add ‘.contiguous()’, but no matter how I modify it, I can not improve the warning. The code caused this warning is as follows:
x = x + self.drop_path(self.mlp(self.norm(x), H, W))
However, there is also a strange phenomenon that using “x = x + self.drop_path(self.mlp(x, H, W))”, this warning will be solved.
Please help me!