That’s weird:
I get this error:
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-8-764c673fd541> in <module>()
     10 
     11 m = nn.ConstantPad2d((1,1,1,1), 0)
---> 12 output = m(input)
     13 print(output)

/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.pyc in __call__(self, *input, **kwargs)
    222         for hook in self._forward_pre_hooks.values():
    223             hook(self, input)
--> 224         result = self.forward(*input, **kwargs)
    225         for hook in self._forward_hooks.values():
    226             hook_result = hook(self, input, result)

/usr/local/lib/python2.7/dist-packages/torch/nn/modules/padding.pyc in forward(self, input)
    178 
    179     def forward(self, input):
--> 180         return F.pad(input, self.padding, 'constant', self.value)
    181 
    182     def __repr__(self):

/usr/local/lib/python2.7/dist-packages/torch/nn/functional.pyc in pad(input, pad, mode, value)
   1043             return _functions.thnn.ReplicationPad3d.apply(input, *pad)
   1044     else:
-> 1045         raise NotImplementedError("Only 4D and 5D padding is supported for now")
   1046 
   1047 

NotImplementedError: Only 4D and 5D padding is supported for now

torch.__version__
gives me:
‘0.2.0_3’