class_docstr: Block that connects a single embedder, with middleware and one to multiple heads
class_docstr_tok: ["Block","that","connects","a","single","embedder",",","with","middleware","and","one","to","multiple","heads"]
docstr: Overrides gluon.HybridBlock.hybrid_forward
  :param nd or sym F: ndarray or symbol block
  :param inputs: model inputs, one for each embedder
  :return: head outputs in a tuple
docstr_tok: ["Overrides","gluon.HybridBlock.hybrid_forward",":","param","nd","or","sym","F",":","ndarray","or","symbol","block",":","param","inputs",":","model","inputs",",","one","for","each","embedder",":","return",":","head","outputs","in","a","tuple"]
code: def hybrid_forward(
      self, F, *inputs: Union[NDArray, Symbol]
  ) -> Tuple[Union[NDArray, Symbol], ...]:
      """Overrides gluon.HybridBlock.hybrid_forward
      :param nd or sym F: ndarray or symbol block
      :param inputs: model inputs, one for each embedder
      :return: head outputs in a tuple
      """
      # Input Embeddings
      state_embedding = list()
      for input, embedder in zip(inputs, self._input_embedders):
          state_embedding.append(embedder(input))
  
      # Merger
      if len(state_embedding) == 1:
          state_embedding = state_embedding[0]
      else:
          if self._embedding_merger_type == EmbeddingMergerType.Concat:
              state_embedding = F.concat(
                  *state_embedding, dim=1, name="merger"
              )  # NC or NCHW layout
          elif self._embedding_merger_type == EmbeddingMergerType.Sum:
              state_embedding = F.add_n(*state_embedding, name="merger")
  
      # Middleware
      state_embedding = self.middleware(state_embedding)
  
      # Head
      outputs = tuple()
      for head in self._output_heads:
          out = head(state_embedding)
          if not isinstance(out, tuple):
              out = (out,)
          outputs += out
  
      return outputs
  
imports: import copy
  from itertools import chain
  from typing import List, Tuple, Union
  from types import ModuleType
  import numpy
  import mxnet
  from mxnet import nd, sym
  from mxnet.gluon import HybridBlock
  from mxnet.ndarray import NDArray
  from mxnet.symbol import Symbol
  from rl_coach.base_parameters import NetworkParameters
  from rl_coach.architectures.embedder_parameters import InputEmbedderParameters
  from rl_coach.architectures.head_parameters import HeadParameters, PPOHeadParameters
  from rl_coach.architectures.head_parameters import PPOVHeadParameters, VHeadParameters, QHeadParameters
  from rl_coach.architectures.middleware_parameters import MiddlewareParameters
  from rl_coach.architectures.middleware_parameters import FCMiddlewareParameters, LSTMMiddlewareParameters
  from rl_coach.architectures.mxnet_components.architecture import MxnetArchitecture
  from rl_coach.architectures.mxnet_components.embedders import ImageEmbedder, TensorEmbedder, VectorEmbedder
  from rl_coach.architectures.mxnet_components.heads import Head, HeadLoss, PPOHead, PPOVHead, VHead, QHead
  from rl_coach.architectures.mxnet_components.middlewares import FCMiddleware, LSTMMiddleware
  from rl_coach.architectures.mxnet_components import utils
  from rl_coach.base_parameters import AgentParameters, Device, DeviceType, EmbeddingMergerType
  from rl_coach.spaces import SpacesDefinition, PlanarMapsObservationSpace, TensorObservationSpace
label_desc: Use image node_id 2 for calling the SingleModel obj's underlying member method code with example usage: obj.hybrid_forward(F) and returns: outputs