Created by: chenwhql
Add input->lod().empty()
check in the following 14 ops' Compute
function, make the input type error hints are more user friendly.
sequence_concat_op.h
sequence_conv_op.h
sequence_enumerate_op.h
sequence_erase_op.h
sequence_expand_as_op.h
sequence_expand_op.h
sequence_pad_op.h
sequence_pool_op.h
sequence_reshape_op.h
sequence_reverse_op.h
sequence_scatter_op.h
sequence_slice_op.h
sequence_softmax_op.h
sequence_topk_avg_pooling_op.h
The result is like
These two ops doesn't use the LoD info of Input, so no check added.
sequence_mask_op.h
sequence_unpad_op.h
Test case
import numpy
import paddle.fluid as fluid
x = fluid.layers.data(name='x', shape=[10,10], append_batch_size=False, dtype='float32')
x_conved = fluid.layers.sequence_last_step(input=x)
place = fluid.CPUPlace()
exe = fluid.Executor(place)
input = numpy.random.random([10,10]).astype('float32')
exe.run(fluid.default_main_program(), feed={'x': input})