Created by: Aurelius84
- embedding don't support
np.dype
indtype
Test Code:
import paddle.fluid as fluid
import numpy as np
x = fluid.layers.data(name='x', shape=[1], dtype='int64', lod_level=1)
emb = fluid.layers.embedding(input=x, size=(128, 100), dtype=np.float32)
It will exit with error:
Traceback (most recent call last):
File "test.py", line 6, in <module>
input=x, size=(128, 100), dtype=np.float32)
File "/Users/XXX/Documents/project/ENV2.7/lib/python2.7/site-packages/paddle/fluid/layers/nn.py", line 400, in embedding
attr=helper.param_attr, shape=size, dtype=dtype, is_bias=False)
File "/Users/XXX/Documents/project/ENV2.7/lib/python2.7/site-packages/paddle/fluid/layer_helper_base.py", line 288, in create_parameter
if not (dtype.startswith("float") or dtype == "double"):
AttributeError: type object 'numpy.float32' has no attribute 'startswith'