Having adjustedf the maxpool line to:
self.pool=nn.MaxPool1d(22,stride=1,padding=10,dilation=1,return_indices=True)

and
def forward(self, data):
       data,indices=self.pool(data)
       return data, indices

Which is fed into a decoder using:
        self.unpool=nn.MaxUnpool1d(22,stride=1,padding=10)

and
    def forward(self, z2,indices):
         z2=self.unpool(z2,indices, output_size=input.size())

I am now getting the error:
    model(*x)

  File "d:\Users\CHARLIE\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)

TypeError: forward() missing 1 required positional argument: 'indices'