@@ -8065,28 +8065,22 @@ def bilinear_tensor_product(x,
8065
8065
.. math::
8066
8066
out{i} = x * W_{i} * {y^\mathrm{T}}, i=0,1,...,size-1
8067
8067
8068
- In this formular :
8068
+ In this formula :
8069
8069
- :math:`x`: the first input contains M elements, shape is [batch_size, M].
8070
8070
- :math:`y`: the second input contains N elements, shape is [batch_size, N].
8071
8071
- :math:`W_{i}`: the i-th learned weight, shape is [M, N]
8072
8072
- :math:`out{i}`: the i-th element of out, shape is [batch_size, size].
8073
8073
- :math:`y^\mathrm{T}`: the transpose of :math:`y_{2}`.
8074
8074
8075
- The simple usage is:
8076
-
8077
- .. code-block:: python
8078
-
8079
- tensor = bilinear_tensor_product(x=layer1, y=layer2, size=1000)
8080
-
8081
8075
Args:
8082
8076
x (Variable): 2-D input tensor with shape [batch_size, M]
8083
8077
y (Variable): 2-D input tensor with shape [batch_size, N]
8084
8078
size (int): The dimension of this layer.
8085
8079
act (str, default None): Activation to be applied to the output of this layer.
8086
8080
name (str, default None): The name of this layer.
8087
- param_attr (ParamAttr|list of ParamAttr , default None): The parameter attribute for learnable
8081
+ param_attr (ParamAttr, default None): The parameter attribute for the learnable w.
8088
8082
parameters/weights of this layer.
8089
- bias_attr (ParamAttr|list of ParamAttr , default None): The parameter attribute for the bias
8083
+ bias_attr (ParamAttr, default None): The parameter attribute for the bias
8090
8084
of this layer. If it is set to False, no bias will be added to the output units.
8091
8085
If it is set to None, the bias is initialized zero. Default: None.
8092
8086
@@ -8096,7 +8090,7 @@ def bilinear_tensor_product(x,
8096
8090
Examples:
8097
8091
.. code-block:: python
8098
8092
8099
- position_tensor = fluid.layers.add_position_encoding(input=tensor )
8093
+ tensor = bilinear_tensor_product(x=layer1, y=layer2, size=1000 )
8100
8094
"""
8101
8095
helper = LayerHelper ('bilinear_tensor_product' , ** locals ())
8102
8096
dtype = helper .input_dtype ('x' )
0 commit comments