docstr: Used for forward pass through LSTM middleware network.
  Applies dense layers from selected scheme before passing result to LSTM layer.
  
  :param F: backend api, either `mxnet.nd` or `mxnet.sym` (if block has been hybridized).
  :param x: state embedding, of shape (batch_size, in_channels).
  :return: state middleware embedding, where shape is (batch_size, channels).
docstr_tok: ["Used","for","forward","pass","through","LSTM","middleware","network",".","Applies","dense","layers","from","selected","scheme","before","passing","result","to","LSTM","layer",".",":","param","F",":","backend","api",",","either","`","mxnet.nd","`","or","`","mxnet.sym","`","(","if","block","has","been","hybridized",")",".",":","param","x",":","state","embedding",",","of","shape","(","batch_size",",","in_channels",")",".",":","return",":","state","middleware","embedding",",","where","shape","is","(","batch_size",",","channels",")","."]
code: def hybrid_forward(
      self, F: ModuleType, x: nd_sym_type, *args, **kwargs
  ) -> nd_sym_type:
      """
      Used for forward pass through LSTM middleware network.
      Applies dense layers from selected scheme before passing result to LSTM layer.
  
      :param F: backend api, either `mxnet.nd` or `mxnet.sym` (if block has been hybridized).
      :param x: state embedding, of shape (batch_size, in_channels).
      :return: state middleware embedding, where shape is (batch_size, channels).
      """
      x_ntc = x.reshape(shape=(0, 0, -1))
      emb_ntc = super(LSTMMiddleware, self).hybrid_forward(
          F, x_ntc, *args, **kwargs
      )
      emb_tnc = emb_ntc.transpose(axes=(1, 0, 2))
      return self.lstm(emb_tnc)
  
file_path: coach/rl_coach/architectures/mxnet_components/middlewares/lstm_middleware.py
imports: from typing import Union
  from types import ModuleType
  import mxnet
  from mxnet.gluon import rnn
  from rl_coach.architectures.mxnet_components.layers import Dense
  from rl_coach.architectures.mxnet_components.middlewares.middleware import Middleware
  from rl_coach.architectures.middleware_parameters import LSTMMiddlewareParameters
  from rl_coach.base_parameters import MiddlewareScheme
label_desc: Use image node_id 3 for calling the LSTMMiddleware obj's underlying member method code with example usage: obj.hybrid_forward(F, x) and returns: self