class_docstr: Base class inherited by all memory network classes.
  
  Args:
      raw_memory_dim (int): Dimension size of raw memory entries
          (before embedding). For example,
          if a raw memory entry is a word, this is the **vocabulary size**
          (imagine a one-hot representation of word). If a raw memory entry
          is a dense vector, this is the dimension size of the vector.
      input_embed_fn (optional): A callable that embeds raw memory entries
          as inputs.
          This corresponds to the `A` embedding operation in
          (Sukhbaatar et al.)
          If not provided, a default embedding operation is created as
          specified in :attr:`hparams`. See
          :meth:`~texar.tf.modules.MemNetBase.get_default_embed_fn`
          for details.
      output_embed_fn (optional): A callable that embeds raw memory entries
          as outputs.
          This corresponds to the `C` embedding operation in
          (Sukhbaatar et al.)
          If not provided, a default embedding operation is created as
          specified in :attr:`hparams`. See
          :meth:`~texar.tf.modules.MemNetBase.get_default_embed_fn`
          for details.
      query_embed_fn (optional): A callable that embeds query.
          This corresponds to the `B` embedding operation in
          (Sukhbaatar et al.). If not provided and "use_B" is True
          in :attr:`hparams`, a default embedding operation is created as
          specified in :attr:`hparams`. See
          :meth:`~texar.tf.modules.MemNetBase.get_default_embed_fn`
          for details.
          Notice: If you'd like to customize this callable, please follow
          the same number and style of dimensions as in `input_embed_fn` or
          `output_embed_fn`, and assume that the 2nd dimension of its
          input and output (which corresponds to `memory_size`) is 1.
      hparams (dict or HParams, optional): Hyperparameters. Missing
          hyperparamerter will be set to default values. See
          :meth:`default_hparams` for the hyperparameter sturcture and
          default values.
code: def _build_embed_fn(
      self, input_embed_fn, output_embed_fn, query_embed_fn
  ):
      # Optionally creates embed_fn's
      memory_dim = self.hparams.memory_dim
      mdim_A, mdim_C, mdim_B = None, None, None
  
      A = input_embed_fn
      if input_embed_fn is None:
          A, mdim_A = self.get_default_embed_fn(
              self._memory_size, self._hparams.A
          )
          memory_dim = mdim_A
  
      C = output_embed_fn
      if output_embed_fn is None:
          C, mdim_C = self.get_default_embed_fn(
              self._memory_size, self._hparams.C
          )
          if mdim_A is not None and mdim_A != mdim_C:
              raise ValueError(
                  "Embedding config `A` and `C` must have "
                  "the same output dimension."
              )
          memory_dim = mdim_C
  
      B = query_embed_fn
      if query_embed_fn is None and self._hparams.use_B:
          B, mdim_B = self.get_default_embed_fn(1, self._hparams.B)
          if mdim_A is not None and mdim_A != mdim_B:
              raise ValueError(
                  "Embedding config `A` and `B` must have "
                  "the same output dimension."
              )
          if mdim_C is not None and mdim_C != mdim_B:
              raise ValueError(
                  "Embedding config `C` and `B` must have "
                  "the same output dimension."
              )
          memory_dim = mdim_B
  
      return A, C, B, memory_dim
  
imports: import tensorflow
  from texar.tf.module_base import ModuleBase
  from texar.tf.modules.embedders import WordEmbedder, PositionEmbedder
  from texar.tf.utils.mode import switch_dropout
  from texar.tf.modules.memory.embed_fns import default_memnet_embed_fn_hparams
label_desc: Use image node_id 2 for calling the MemNetBase obj's underlying member method code with example usage: obj._build_embed_fn(input_embed_fn, output_embed_fn, query_embed_fn) and returns: A,  C,  B,  memory_dim