@I-Love-U did you figure this out, I am getting the same error, I have no clue why this is happening.
[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.
grad.sizes() = [64, 32, 1, 1], strides() = [32, 1, 1, 1]
param.sizes() = [64, 32, 1, 1], strides() = [32, 1, 32, 32] (function operator())
My Feature vector is of  64-d. The only thing I suspect in my code is that I am doing two separate forward passes in my learning loop through the same network.