You shouldn’t save the pooling index in the constructor. This should work:
class MyModule1(nn.Module):
    def __init__(self):
    super(MyModule1, self).__init__()
    self.conv = nn.Conv2d(64, 3, 4)
    self.pool = nn.MaxPool2d(3, 3, return_indices = True)

    def foward(self, x):
        x = self.convl(x)
        x, pool_idx = self.pool(x)
        return x, pool_idx

class MyModule2(nn.Module):
    def __init__(self):
    super(MyModule2, self).__init__()
    self.conv = nn.ConvTransposed2d(3, 64, 4)
    self.unpool = nn.MaxUnpool2d(3,3)

    def forward(self, x, pool_idx):
        x = self.unpool(x, pool_idx)
        x = self.conv(x)
        return x

class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.m1 = MyModule1()
        self.m2 = MyModule2()

    def forward(self, x):
        x, pool_idx = self.m1(x)
        x = self.m2(x, pool_idx)
        return x