Max_unpool2D error

I want to double the size of the input so I am using maxUnpool2d
Input size: 1x16x16
Desired size: 1x32x32
I write this:
nnFunctions.max_unpool2d(self.resnet.layer4(x),kernel_size=(2,2),stride=(2,2))
But I get the following error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 net=train(train_loader,net,1,410)

<ipython-input-26-0904d8b22f1a> in train(train_loader, net, epochs, total_samples)
     15 
     16             # forward + backward + optimize
---> 17             outputs = net(inputs)
     18             loss = criterion(outputs, labels)
     19             loss.backward()

/home/sarthak/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc in __call__(self, *input, **kwargs)
    208 
    209     def __call__(self, *input, **kwargs):
--> 210         result = self.forward(*input, **kwargs)
    211         for hook in self._forward_hooks.values():
    212             hook_result = hook(self, input, result)

<ipython-input-20-808a1f82a64b> in forward(self, x)
     17         x=self.resnet.layer2(x)
     18         x=self.resnet.layer3(x)
---> 19         x=nnFunctions.max_unpool2d(self.resnet.layer4(x),kernel_size=(2,2),stride=(2,2))
     20         x=self.custom_net(x)
     21         return x

TypeError: max_unpool2d() takes at least 3 arguments (3 given)

What should be passed in place of index. I have a pretrained model Resnet and a custom model that I created.

you should set the property return_indices=True on your pooling layers.

See the documentation example for one usage:
http://pytorch.org/docs/nn.html#maxunpool2d

Resnet is pretrained so how can i obtain the indices from the pretrained pooling model

“set the property return_indices=True on your pooling layers.”