follow comments.

emailweixu-patch-1
ying 7 years ago
parent d00eb53a93
commit 7210d0fa95

@ -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:

@ -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:

@ -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.")

Loading…
Cancel
Save