fused_embedding_seq_pool¶
- paddle.fluid.contrib.layers.nn. fused_embedding_seq_pool ( input, size, is_sparse=False, padding_idx=None, combiner='sum', param_attr=None, dtype='float32' ) [source]
-
Embedding Sequence pool
This layer is the fusion of lookup table and sequence_pool.
- Parameters
-
input (Variable) – Input is a Tensor<int64> Variable, which contains the IDs’ information. The value of the input IDs should satisfy \(0<= id < size[0]\).
size (tuple|list) – The shape of the lookup_table parameter. It should have two elements which indicate the size of the dictionary of embedding and the size of each embedding vector respectively.
is_sparse (bool) – The flag indicating whether to use sparse update. Default: False.
padding_idx (int|long|None) – It will output all-zero padding data whenever lookup encounters \(padding\_idx\) in Ids. If set
None
, it makes no effect to output. If \(padding\_idx < 0\), the \(padding\_idx\) will automatically be converted to \(size[0] + padding\_idx\) to use. Default: None.combiner (str) – The pooling type of sequence_pool, and only support sum. Default: sum.
param_attr (ParamAttr) – Parameters for this layer.
dtype (np.dtype|core.VarDesc.VarType|str) – The dtype refers to the data type of output tensor. It can be float32, float_16, int etc.
- Returns
-
The sequence pooling variable which is a Tensor.
Examples