the output tensor's 'dtype' of 'uniform_random' is not set
Created by: houj04
Brief According to the API doc of 'uniform_random' (see http://paddlepaddle.org/documentation/docs/zh/1.2/api/layers.html#uniform-random), the default 'dtype' is:
dtype (INT) – Output tensor data type. [default 5(FP32)].
But in fact, the dtype of returned tensor is not set to 5. System information -PaddlePaddle version: 1.2.1 -OS Platform and Distribution: Ubuntu 18.04 -Python version: Python 2.7.15rc1 To Reproduce Just use the code provided in API doc:
import paddle.fluid as fluid
result = fluid.layers.uniform_random(shape=[32, 784])
print result
Describe your current behavior
Traceback (most recent call last):
File "uniform_random.py", line 3, in <module>
print result
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/framework.py", line 350, in __str__
return self.to_string(True)
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/framework.py", line 370, in to_string
res_str = _debug_string_(proto, throw_on_error)
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/framework.py", line 201, in _debug_string_
format(error_fields, proto))
ValueError: ['type.lod_tensor.tensor.data_type'] are not initialized.