If you would create the max pooling layer so that the kernel size equals the input size in the temporal or spatial dimension, then yes, you can alternatively use torch.max.
Based on the input shape and your desired output shape of [1, 8], you could use torch.max(x, 0, keepdim=True)[0].
Alternatively, have a look at adaptive pooling layers, which yield the same output shape for variable sized inputs.