parameters: (params, ids, name='embedding_lookup')
docstring: Provides a N dimensional version of tf.embedding_lookup.
  
    Ids are flattened to a 1d tensor before being passed to embedding_lookup
    then, they are unflattend to match the original ids shape plus an extra
    leading dimension of the size of the embeddings.
  
    Args:
      params: List of tensors of size D0 x D1 x ... x Dn-2 x Dn-1.
      ids: N-dimensional tensor of B0 x B1 x .. x Bn-2 x Bn-1.
        Must contain indexes into params.
      name: Optional name for the op.
  
    Returns:
      A tensor of size B0 x B1 x .. x Bn-2 x Bn-1 x D1 x ... x Dn-2 x Dn-1
      containing the values from the params tensor(s) for indecies in ids.
  
    Raises:
      ValueError: if some parameters are invalid.
docstring_summary: Provides a N dimensional version of tf.embedding_lookup.
docstring_tokens: Provides a N dimensional version of tf . embedding_lookup .
function: def embedding_lookup(params, ids, name='embedding_lookup'):
    """Provides a N dimensional version of tf.embedding_lookup.
  
    Ids are flattened to a 1d tensor before being passed to embedding_lookup
    then, they are unflattend to match the original ids shape plus an extra
    leading dimension of the size of the embeddings.
  
    Args:
      params: List of tensors of size D0 x D1 x ... x Dn-2 x Dn-1.
      ids: N-dimensional tensor of B0 x B1 x .. x Bn-2 x Bn-1.
        Must contain indexes into params.
      name: Optional name for the op.
  
    Returns:
      A tensor of size B0 x B1 x .. x Bn-2 x Bn-1 x D1 x ... x Dn-2 x Dn-1
      containing the values from the params tensor(s) for indecies in ids.
  
    Raises:
      ValueError: if some parameters are invalid.
    """
    with ops.name_scope(name, 'embedding_lookup', [params, ids]):
      params = ops.convert_to_tensor(params)
      ids = ops.convert_to_tensor(ids)
      shape = array_ops_.shape(ids)
      ids_flat = array_ops_.reshape(
          ids, math_ops.reduce_prod(shape, keepdims=True))
      embeds_flat = nn.embedding_lookup(params, ids_flat, name)
      embed_shape = array_ops_.concat([shape, [-1]], 0)
      embeds = array_ops_.reshape(embeds_flat, embed_shape)
      embeds.set_shape(ids.get_shape().concatenate(params.get_shape()[1:]))
      return embeds
function_tokens: def embedding_lookup ( params , ids , name = 'embedding_lookup' ) : with ops . name_scope ( name , 'embedding_lookup' , [ params , ids ] ) : params = ops . convert_to_tensor ( params ) ids = ops . convert_to_tensor ( ids ) shape = array_ops_ . shape ( ids ) ids_flat = array_ops_ . reshape ( ids , math_ops . reduce_prod ( shape , keepdims = True ) ) embeds_flat = nn . embedding_lookup ( params , ids_flat , name ) embed_shape = array_ops_ . concat ( [ shape , [ - 1 ] ] , 0 ) embeds = array_ops_ . reshape ( embeds_flat , embed_shape ) embeds . set_shape ( ids . get_shape ( ) . concatenate ( params . get_shape ( ) [ 1 : ] ) ) return embeds