class_docstr: Tests :class:`~texar.tf.modules.memory.memory_network.MemNetRNNLike`.
      
docstr: Tests :attr:`memory_dim` in the :attr:`combine_mode` and soft
  options.
docstr_tok: ["Tests",":","attr",":","`","memory_dim","`","in","the",":","attr",":","`","combine_mode","`","and","soft","options","."]
code: def _test_memory_dim(
      self,
      combine_mode="add",
      soft_memory=False,
      soft_query=False,
      use_B=False,
  ):
      """Tests :attr:`memory_dim` in the :attr:`combine_mode` and soft
      options.
      """
      print(
          "testing: combine_mode={}, soft_memory={}, soft_query={}, "
          "use_B={}".format(
              combine_mode, soft_memory, soft_query, use_B
          )
      )
  
      n_hops = 3
      if combine_mode == "add" or combine_mode is None:
          memory_dim = 19
          embedding_dim = memory_dim
          temporal_embedding_dim = memory_dim
      elif combine_mode == "concat":
          embedding_dim = 19
          temporal_embedding_dim = 17
          memory_dim = embedding_dim + temporal_embedding_dim
      else:
          raise ValueError(
              "combine_mode = {} is not recognized".format(combine_mode)
          )
      relu_dim = 13
      memory_size = 7
      raw_memory_dim = 11
      batch_size = 2
      embed_hparams = {
          "embedding": {
              "dim": embedding_dim,
          },
          "temporal_embedding": {
              "dim": temporal_embedding_dim,
          },
          "combine_mode": combine_mode,
      }
      memnet_hparams = {
          "n_hops": n_hops,
          "relu_dim": relu_dim,
          "memory_size": memory_size,
          "A": embed_hparams,
          "C": embed_hparams,
          "B": embed_hparams,
          "use_B": use_B,
      }
      memnet = MemNetRNNLike(
          raw_memory_dim=raw_memory_dim, hparams=memnet_hparams
      )
      kwargs = {}
      if soft_memory:
          kwargs["soft_memory"] = tf.random_uniform(
              [batch_size, memory_size, raw_memory_dim]
          )
      else:
          kwargs["memory"] = tf.tile(
              tf.expand_dims(tf.range(memory_size, dtype=tf.int32), 0),
              [batch_size, 1],
          )
      if use_B:
          if soft_query:
              kwargs["soft_query"] = tf.random_uniform(
                  [batch_size, raw_memory_dim]
              )
          else:
              kwargs["query"] = tf.random_uniform(
                  [batch_size], maxval=raw_memory_dim, dtype=tf.int32
              )
      else:
          kwargs["query"] = tf.random_uniform([batch_size, memory_dim])
      logits = memnet(**kwargs)
      self.assertEqual(memnet.memory_dim, memory_dim)
      self.assertEqual(logits.shape[0], batch_size)
      self.assertEqual(logits.shape[1], raw_memory_dim)
  
imports: import tensorflow
  from texar.tf.modules.memory.memory_network import MemNetRNNLike
  from texar.tf import context
label_desc: Use image node_id 1 for calling the MemNetRNNLikeTest obj's underlying member method code with example usage: obj._test_memory_dim(combine_mode, soft_memory, soft_query, use_B) without return types