class_docstr: The base embedder class that all embedder classes inherit.
  
  Args:
      num_embeds (int, optional): The number of embedding elements, e.g.,
          the vocabulary size of a word embedder.
      hparams (dict or HParams, optional): Embedder hyperparameters. Missing
          hyperparamerter will be set to default values. See
          :meth:`default_hparams` for the hyperparameter structure and
          default values.
class_docstr_tok: ["The","base","embedder","class","that","all","embedder","classes","inherit",".","Args",":","num_embeds","(","int",",","optional",")",":","The","number","of","embedding","elements",",","e.g.",",","the","vocabulary","size","of","a","word","embedder",".","hparams","(","dict","or","HParams",",","optional",")",":","Embedder","hyperparameters",".","Missing","hyperparamerter","will","be","set","to","default","values",".","See",":","meth",":","`","default_hparams","`","for","the","hyperparameter","structure","and","default","values","."]
docstr: Creates dropout layer according to dropout strategy.
  Called in :meth:`_build`.
docstr_tok: ["Creates","dropout","layer","according","to","dropout","strategy",".","Called","in",":","meth",":","`","_build","`","."]
code: def _get_dropout_layer(
      self,
      hparams,
      ids_rank=None,
      dropout_input=None,
      dropout_strategy=None,
  ):
      r"""Creates dropout layer according to dropout strategy.
      Called in :meth:`_build`.
      """
      dropout_layer = None
  
      st = dropout_strategy
      st = hparams.dropout_strategy if st is None else st
  
      if hparams.dropout_rate > 0.0:
          if st == "element":
              noise_shape = None
          elif st == "item":
              assert dropout_input is not None
              assert ids_rank is not None
              noise_shape = (
                  shape_list(dropout_input)[:ids_rank]
                  + [1] * self._dim_rank
              )
          elif st == "item_type":
              noise_shape = [None] + [1] * self._dim_rank  # type: ignore
          else:
              raise ValueError(
                  "Unknown dropout strategy: {}".format(st)
              )
  
          dropout_layer = tf.layers.Dropout(
              rate=hparams.dropout_rate, noise_shape=noise_shape
          )
  
      return dropout_layer
  
file_path: texar/texar/tf/modules/embedders/embedder_base.py
imports: import tensorflow
  from texar.tf.module_base import ModuleBase
  from texar.tf.modules.embedders import embedder_utils
  from texar.tf.utils.shapes import shape_list
label_desc: Use image node_id 3 for calling the EmbedderBase obj's underlying member method code with example usage: obj._get_dropout_layer(hparams, ids_rank, dropout_input, dropout_strategy) and returns: dropout_layer