Learning the initial hidden state of RNN

I want to learn the hidden state of the RNN but have no idea how to do it. The shape of the hidden state depends upon the batch_size and due to that I am unable to make any Parameter for it.

How can I do that?