"array_read" API demo doesn't work
Created by: houj04
System information -PaddlePaddle version: 1.2.1 -OS Platform and Distribution: Ubuntu 18.04 -Python version: Python 2.7.15rc1
To Reproduce Use the code example provided in the following API doc: http://paddlepaddle.org/documentation/docs/zh/1.2/api_cn/layers_cn.html#cn-api-fluid-layers-array-read
Describe your current behavior
Traceback (most recent call last):
File "array_read.py", line 4, in <module>
arr = fluid.layers.array_read(tmp,i=i)
File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/layers/control_flow.py", line 1103, in array_read
raise TypeError("array should be tensor array vairable")
TypeError: array should be tensor array vairable
Code to reproduce the issue
import paddle.fluid as fluid
tmp = fluid.layers.zeros(shape=[10],dtype='int32')
i = fluid.layers.fill_constant(shape=[1],dtype='int64',value=10)
arr = fluid.layers.array_read(tmp,i=i)
Others BTW, there is a typo in error message, "vairable" should be "variable".