Following your suggestions, I tried the following and ran into the following problem. Would you please help have a look. Thanks a lot!
x = torch.nn.Conv2d(10, 10, [3, 3], groups=10) # in_channels = 10, out_channels = 10
img = torch.autograd.Variable( torch.randn(10, 5, 5) )  # in_channels = 10
o = x(img)

Traceback (most recent call last):
  File "<pyshell#47>", line 1, in <module>
    o = x(img);
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 237, in forward
    self.padding, self.dilation, self.groups)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/torch/nn/functional.py", line 39, in conv2d
    return f(input, weight, bias)
RuntimeError: expected 3D tensor