From 3242e286e64a95e6ac936fbeda814c77bd37ef53 Mon Sep 17 00:00:00 2001 From: yangyaming Date: Mon, 18 Dec 2017 16:37:28 +0800 Subject: [PATCH] seq_expand --> sequence_expand --- doc/api/v2/fluid/layers.rst | 4 ++-- python/paddle/v2/fluid/layers/nn.py | 16 ++++++++-------- python/paddle/v2/fluid/tests/test_layers.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/api/v2/fluid/layers.rst b/doc/api/v2/fluid/layers.rst index c3436ca6bc..9f3669e115 100644 --- a/doc/api/v2/fluid/layers.rst +++ b/doc/api/v2/fluid/layers.rst @@ -300,7 +300,7 @@ conv2d_transpose .. autofunction:: paddle.v2.fluid.layers.conv2d_transpose :noindex: -seq_expand +sequence_expand --------- -.. autofunction:: paddle.v2.fluid.layers.seq_expand +.. autofunction:: paddle.v2.fluid.layers.sequence_expand :noindex: diff --git a/python/paddle/v2/fluid/layers/nn.py b/python/paddle/v2/fluid/layers/nn.py index bed46e4972..2be8c8af9b 100644 --- a/python/paddle/v2/fluid/layers/nn.py +++ b/python/paddle/v2/fluid/layers/nn.py @@ -10,7 +10,7 @@ __all__ = [ 'fc', 'embedding', 'dynamic_lstm', 'gru_unit', 'linear_chain_crf', 'crf_decoding', 'cos_sim', 'cross_entropy', 'square_error_cost', 'accuracy', 'chunk_eval', 'sequence_conv', 'conv2d', 'sequence_pool', 'pool2d', - 'batch_norm', 'beam_search_decode', 'conv2d_transpose', 'seq_expand' + 'batch_norm', 'beam_search_decode', 'conv2d_transpose', 'sequence_expand' ] @@ -791,10 +791,10 @@ def conv2d_transpose(input, return out -def seq_expand(x, y, main_program=None, startup_program=None): +def sequence_expand(x, y, main_program=None, startup_program=None): """Sequence Expand Layer. This layer will expand the input variable **x** according to LoD information of **y**. And the following examples will - explain how seq_expand works: + explain how sequence_expand works: .. code-block:: text @@ -823,7 +823,7 @@ def seq_expand(x, y, main_program=None, startup_program=None): x.dims = [3, 1] y is a LoDTensor: - Y.lod = [[0, 2, 3, 6]] + y.lod = [[0, 2, 3, 6]] with condition len(y.lod[-1]) - 1 == x.dims[0] @@ -847,12 +847,12 @@ def seq_expand(x, y, main_program=None, startup_program=None): x = fluid.layers.data(name='x', shape=[10], dtype='float32') y = fluid.layers.data(name='y', shape=[10, 20], dtype='float32', lod_level=1) - out = layers.seq_expand(x=x, y=y) + out = layers.sequence_expand(x=x, y=y) """ - helper = LayerHelper('seq_expand', input=x, **locals()) + helper = LayerHelper('sequence_expand', input=x, **locals()) dtype = helper.input_dtype() tmp = helper.create_tmp_variable(dtype) helper.append_op( - type='seq_expand', inputs={'X': x, - 'Y': y}, outputs={'Out': tmp}) + type='sequence_expand', inputs={'X': x, + 'Y': y}, outputs={'Out': tmp}) return tmp diff --git a/python/paddle/v2/fluid/tests/test_layers.py b/python/paddle/v2/fluid/tests/test_layers.py index d6f939af23..2286e94a90 100644 --- a/python/paddle/v2/fluid/tests/test_layers.py +++ b/python/paddle/v2/fluid/tests/test_layers.py @@ -167,7 +167,7 @@ class TestBook(unittest.TestCase): x = layers.data(name='x', shape=[10], dtype='float32') y = layers.data( name='y', shape=[10, 20], dtype='float32', lod_level=1) - self.assertIsNotNone(layers.seq_expand(x=x, y=y)) + self.assertIsNotNone(layers.sequence_expand(x=x, y=y)) print(str(program)) -- GitLab