$$
\begin{array}{ll} \\
i_t = \sigma(W_{ii} x_t + W_{hi} h_{(t-1)} ) \\
f_t = \sigma(W_{if} x_t + W_{hf} h_{(t-1)} ) \\
g_t = \tanh(W_{ig} x_t + W_{hg} h_{(t-1)} ) \\
o_t = \sigma(W_{io} x_t + W_{ho} h_{(t-1)} ) \\
c_t = f_t \odot c_{(t-1)} + i_t \odot g_t \\
h_t = o_t \odot \tanh(c_t) \\
\end{array}
$$
The choices in LSTM are arbitrary, several variants of LSTMs exist
Thankfully, there is a predefined LSTM model in PyTorch