Since my original data is 2D, I did the following:
    # input: (W, D)
    # use 1 batch only

    x = x.unsqueeze(0)  # (N, W, D)
    x = x.unsqueeze(1)  # (N, Ci, W, D)

I believe after doing that, it is ok. However, this error is only happening when I am using GPU. When I am using CPU, there is no error.
I guess pytorch library has another bug in their code. Anyone has a solution?