|
|
|
@ -928,7 +928,7 @@ def dynamic_gru(input,
|
|
|
|
|
emb = fluid.layers.embedding(input=data, size=[dict_dim, emb_dim])
|
|
|
|
|
hidden_dim = 512
|
|
|
|
|
x = fluid.layers.fc(input=emb, size=hidden_dim * 3)
|
|
|
|
|
hidden = fluid.layers.dynamic_gru(input=x, dim=hidden_dim)
|
|
|
|
|
hidden = fluid.layers.dynamic_gru(input=x, size=hidden_dim)
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
helper = LayerHelper('gru', **locals())
|
|
|
|
@ -3586,6 +3586,7 @@ def beam_search_decode(ids, scores, beam_size, end_id, name=None):
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
|
|
# Suppose `ids` and `scores` are LodTensorArray variables reserving
|
|
|
|
|
# the selected ids and scores of all steps
|
|
|
|
|
finished_ids, finished_scores = layers.beam_search_decode(
|
|
|
|
@ -5870,7 +5871,6 @@ def pad_constant_like(x, y, pad_value=0., name=None):
|
|
|
|
|
[[38, 39, 40]],
|
|
|
|
|
[[41, 42, 43]]]]
|
|
|
|
|
Y.shape = (1, 3, 1, 3)
|
|
|
|
|
|
|
|
|
|
And
|
|
|
|
|
pad_value = -1,
|
|
|
|
|
|
|
|
|
@ -6126,6 +6126,7 @@ def image_resize(input,
|
|
|
|
|
Supporting resample methods:
|
|
|
|
|
|
|
|
|
|
'BILINEAR' : Bilinear interpolation
|
|
|
|
|
|
|
|
|
|
'NEAREST' : Nearest neighbor interpolation
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
@ -6781,7 +6782,7 @@ def crop(x, shape=None, offsets=None, name=None):
|
|
|
|
|
|
|
|
|
|
# or
|
|
|
|
|
z = fluid.layers.data(name="z", shape=[3, 5], dtype="float32")
|
|
|
|
|
crop = fluid.layers.crop(z, shape=[2, 3])
|
|
|
|
|
crop = fluid.layers.crop(z, shape=[-1, 2, 3])
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
helper = LayerHelper('crop', **locals())
|
|
|
|
@ -7062,6 +7063,7 @@ def pad2d(input,
|
|
|
|
|
than height-1. And the width dimension has the same condition.
|
|
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
.. code-block:: text
|
|
|
|
|
|
|
|
|
|
Given that X is a channel of image from input:
|
|
|
|
|
|
|
|
|
|