I had to write these functions because it was used in a Wrapper for extracting getting the initial state.
I have written that: Link
    @torch.jit.export
    def get_initial_state(self, bsz):
        #bsz -> batch_size
        #h,c = self.init_hidden(bsz)
        batchsize=bsz.item()
        h=torch.zeros(self.nlayers, batchsize, self.nhid)
        c=torch.zeros(self.nlayers, batchsize, self.nhid)
        return h