In pytorch you can do Conv1d(..., padding=(kernel_size // 2)) which is equivalent to padding=“same” for odd kernel sizes. But that wouldn’t give you causal convolutions.
However Keras now has padding=“causal” for which pytorch has no easy equivalent.