To the best of my knowledge, PyTorch does not perform implicit shape inference (which is what Keras does) unless each module in the Sequential model has implicit shape inference encoded in its forward method.
I’m not sure of the reasoning behind this, but it may be because TensorFlow (what Keras is built on) uses a static computational graph, while PyTorch uses a dynamic one. This would make it impossible for PyTorch to know the output shape of the 1st layer before it runs, while Tensorflow can analyze the static graph it builds to infer input sizes.
In short: you’ll have to specify input and output sizes.