parameters: (ori_module: torch.nn.Module)
return_statement: return ori_module
docstring: replace_torch_lstm_with_stacked_lstm
docstring_summary: replace_torch_lstm_with_stacked_lstm
docstring_tokens: replace_torch_lstm_with_stacked_lstm
function: def convert_lstm(ori_module: torch.nn.Module):
    """replace_torch_lstm_with_stacked_lstm
  
    """
    
    if isinstance(ori_module, torch.nn.LSTM):
      return stacked_lstm(ori_module)
    
    for n, m in ori_module.named_children():
      if isinstance(m, torch.nn.LSTM):
        setattr(ori_module, n, stacked_lstm(m))
      else:
        convert_lstm(m)    
    return ori_module
function_tokens: def convert_lstm ( ori_module : torch . nn . Module ) : if isinstance ( ori_module , torch . nn . LSTM ) : return stacked_lstm ( ori_module ) for n , m in ori_module . named_children ( ) : if isinstance ( m , torch . nn . LSTM ) : setattr ( ori_module , n , stacked_lstm ( m ) ) else : convert_lstm ( m ) return ori_module