提交 9e7c0686 编写于 作者: C chengduoZH

fix embedding example

上级 682c184c
...@@ -163,8 +163,9 @@ def embedding(input, size, is_sparse=False, param_attr=None, dtype='float32'): ...@@ -163,8 +163,9 @@ def embedding(input, size, is_sparse=False, param_attr=None, dtype='float32'):
Examples: Examples:
.. code-block:: python .. code-block:: python
dict_size = len(dataset.ids)
data = fluid.layers.data(name='ids', shape=[32, 32], dtype='float32') data = fluid.layers.data(name='ids', shape=[32, 32], dtype='float32')
fc = fluid.layers.embedding(input=data, size=16) fc = fluid.layers.embedding(input=data, size=[dict_size, 16])
""" """
helper = LayerHelper('embedding', **locals()) helper = LayerHelper('embedding', **locals())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册