Skip to content

Commit 5cc99c4

Browse files
authored
Merge pull request #14154 from gmcather/seq_pad_example
fix sequence_pad example error
2 parents d186e74 + 1a98e0a commit 5cc99c4

File tree

1 file changed

+2
-1
lines changed
  • python/paddle/fluid/layers

1 file changed

+2
-1
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3020,7 +3020,8 @@ def sequence_pad(x, pad_value, maxlen=None, name=None):
30203020
30213021
x = fluid.layers.data(name='y', shape=[10, 5],
30223022
dtype='float32', lod_level=1)
3023-
pad_value = fluid.layers.assign(input=numpy.array([0]))
3023+
pad_value = fluid.layers.assign(
3024+
input=numpy.array([0], dtype=numpy.float32))
30243025
out = fluid.layers.sequence_pad(x=x, pad_value=pad_value)
30253026
"""
30263027

0 commit comments

Comments
 (0)