LSTM inference slower in Litorch

I have wrote my own LSTMCell as below, because I need to get some parameters of the model from somewhere else.

class MyLSTMCell(nn.LSTMCell):
def init(self, input_size, hidden_size, bias=True, device=None, dtype=None):
┆ super(MyLSTMCell, self).init(input_size, hidden_size, bias, device, dtype)
def forward(self, inputs, hidden, cell, weight_hh, bias_hh):
┆ return torch._VF.lstm_cell(
┆ ┆ ┆ inputs, (hidden, cell), self.weight_ih,
┆ ┆ ┆ weight_hh, self.bias_ih, bias_hh)

But when I transform it to torchscript, and run in libtorch C++, it’s slower than original LSTMCell in pytorch. So what happened? And Is there any way to make it run faster?