Why does pytorch prompt "[W accumulate_grad.h:170] Warning: grad and param do not obey the gradient layout contract. This is not an error, but may impair performance."?

encountered the same issues. Any way to figure out where the problem is or how to debug? Tried to raise error when it is warning by the following, but it does not work.

warnings.filterwarnings(“error”)