class_docstr: The :class:`AverageEmbedding` averages over embeddings of inputs.
  This is often used as the input layer for models like DAN[1] and FastText[2].
  
  Parameters
  ----------
  vocabulary_size : int
      The size of vocabulary.
  embedding_size : int
      The dimension of the embedding vectors.
  pad_value : int
      The scalar padding value used in inputs, 0 as default.
  E_init : initializer
      The initializer of the embedding matrix.
  name : str
      A unique layer name.
  
  Attributes
  ----------
  outputs : tensor
      The embedding layer output is a 2D tensor in the shape: (batch_size, embedding_size).
  
  References
  ----------
  - [1] Iyyer, M., Manjunatha, V., Boyd-Graber, J., & Daum’e III, H. (2015). Deep Unordered Composition Rivals Syntactic Methods for Text Classification. In Association for Computational Linguistics.
  - [2] Joulin, A., Grave, E., Bojanowski, P., & Mikolov, T. (2016). `Bag of Tricks for Efficient Text Classification. <http://arxiv.org/abs/1607.01759>`__
  
  Examples
  ---------
  >>> import tensorflow as tf
  >>> import tensorlayer as tl
  >>> batch_size = 8
  >>> length = 5
  >>> input = tl.layers.Input([batch_size, length], dtype=tf.int32)
  >>> avgembed = tl.layers.AverageEmbedding(vocabulary_size=1000, embedding_size=50, name='avg')
  >>> print(avgembed)
  AverageEmbedding(vocabulary_size=1000, embedding_size=50, pad_value=0)
  >>> tensor = avgembed(input)
  >>> print(tensor)
  tf.Tensor([...], shape=(8, 50), dtype=float32)
class_docstr_tok: ["The",":","class",":","`","AverageEmbedding","`","averages","over","embeddings","of","inputs",".","This","is","often","used","as","the","input","layer","for","models","like","DAN","[","1","]","and","FastText","[","2","]",".","Parameters","--","--","--","--","--","vocabulary_size",":","int","The","size","of","vocabulary",".","embedding_size",":","int","The","dimension","of","the","embedding","vectors",".","pad_value",":","int","The","scalar","padding","value","used","in","inputs",",","0","as","default",".","E_init",":","initializer","The","initializer","of","the","embedding","matrix",".","name",":","str","A","unique","layer","name",".","Attributes","--","--","--","--","--","outputs",":","tensor","The","embedding","layer","output","is","a","2D","tensor","in","the","shape",":","(","batch_size",",","embedding_size",")",".","References","--","--","--","--","--","-","[","1","]","Iyyer",",","M.",",","Manjunatha",",","V.",",","Boyd-Graber",",","J.",",","&","Daum","\u2019","e","III",",","H.","(","2015",")",".","Deep","Unordered","Composition","Rivals","Syntactic","Methods","for","Text","Classification",".","In","Association","for","Computational","Linguistics",".","-","[","2","]","Joulin",",","A.",",","Grave",",","E.",",","Bojanowski",",","P.",",","&","Mikolov",",","T.","(","2016",")",".","`","Bag","of","Tricks","for","Efficient","Text","Classification",".","<","http",":","\/\/arxiv.org\/abs\/1607.01759",">","`","__","Examples","--","--","--","--","-",">",">",">","import","tensorflow","as","tf",">",">",">","import","tensorlayer","as","tl",">",">",">","batch_size","=","8",">",">",">","length","=","5",">",">",">","input","=","tl.layers.Input","(","[","batch_size",",","length","]",",","dtype=tf.int32",")",">",">",">","avgembed","=","tl.layers.AverageEmbedding","(","vocabulary_size=1000",",","embedding_size=50",",","name='avg","'",")",">",">",">","print","(","avgembed",")","AverageEmbedding","(","vocabulary_size=1000",",","embedding_size=50",",","pad_value=0",")",">",">",">","tensor","=","avgembed","(","input",")",">",">",">","print","(","tensor",")","tf.Tensor","(","[","...","]",",","shape=","(","8",",","50",")",",","dtype=float32",")"]
docstr: Parameters
  ----------
  inputs_shape : tuple
      the shape of inputs tensor.
docstr_tok: ["Parameters","--","--","--","--","--","inputs_shape",":","tuple","the","shape","of","inputs","tensor","."]
code: def build(self, inputs_shape):
      """
      Parameters
      ----------
      inputs_shape : tuple
          the shape of inputs tensor.
      """
      # if len(inputs_shape) != 2:
      #     raise ValueError('inputs must be of size (batch_size, sentence_length)')
  
      self.embeddings = self._get_weights(
          "embeddings",
          shape=(self.vocabulary_size, self.embedding_size),
          init=self.E_init,
      )
  
imports: import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer import logging
  from tensorlayer.layers.core import Layer
label_desc: Use image node_id 3 for calling the AverageEmbedding obj's underlying member method code with example usage: obj.build(inputs_shape) without return types