Ah Ok, now I see it.
You are using nn.MaxPool1d, which expects the input to have dimensions [batch, channel, length].
Try to change the line before the pooling operation to: m = rep.view(-1, 1000, 5).
Also, you could define the layers in the __init__ function or use the functional API (F.max_pool1d).