num_chunks is used to initialize the parameters in different RNN variants.
E.g. an LSTM uses num_chunks, as the weight and bias pararameters contain 4 parts as seen in the docs 20 (take a look at the “Variables” section).
It seems your code uses a custom LSTMCell implementation, so you could either use the PyTorch LSTMCell, would need to update the code for your custom layer or keep your code and add the necessary code from the base classes into your current implementation.