From 7210d0fa95279c8fc9fde09f1d578c0988dcbeb2 Mon Sep 17 00:00:00 2001 From: ying Date: Wed, 24 Jan 2018 16:18:02 +0800 Subject: [PATCH] follow comments. --- doc/api/v2/fluid/nets.rst | 2 +- python/paddle/v2/fluid/layers/nn.py | 2 +- python/paddle/v2/fluid/nets.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/v2/fluid/nets.rst b/doc/api/v2/fluid/nets.rst index 8af61977ab..500019bc50 100644 --- a/doc/api/v2/fluid/nets.rst +++ b/doc/api/v2/fluid/nets.rst @@ -28,6 +28,6 @@ glu scaled_dot_product_attention ---------------------------- -.. autofunction:: paddle.v2.fluid.nets.dot_product_attention +.. autofunction:: paddle.v2.fluid.nets.scaled_dot_product_attention :noindex: diff --git a/python/paddle/v2/fluid/layers/nn.py b/python/paddle/v2/fluid/layers/nn.py index 19fee8ec67..07c4f89da6 100644 --- a/python/paddle/v2/fluid/layers/nn.py +++ b/python/paddle/v2/fluid/layers/nn.py @@ -2097,7 +2097,7 @@ def matmul(x, y, transpose_x=False, transpose_y=False, name=None): if len(x_shape) == 1: x_shape = [1] + x_shape if len(y_shape) == 1: - y_shape = [1] + y_shape + y_shape = y_shape + [1] # check the inner 2 dimensions if transpose_x: diff --git a/python/paddle/v2/fluid/nets.py b/python/paddle/v2/fluid/nets.py index e18852c596..cb63d43709 100644 --- a/python/paddle/v2/fluid/nets.py +++ b/python/paddle/v2/fluid/nets.py @@ -306,7 +306,7 @@ def scaled_dot_product_attention(queries, [bs, max_sequence_length, num_heads * hidden_dim]. """ - if len(x.shape) == 3: return + if len(x.shape) == 3: return x if len(x.shape) != 4: raise ValueError("Input(x) should be a 4-D Tensor.") -- GitLab