提交 8b88960d 编写于 作者: D dengkaipeng

fix doc. test=develop

上级 2ddd23da
...@@ -86,7 +86,7 @@ class SoftmaxOpMaker : public framework::OpProtoAndCheckerMaker { ...@@ -86,7 +86,7 @@ class SoftmaxOpMaker : public framework::OpProtoAndCheckerMaker {
void Make() override { void Make() override {
AddInput("X", AddInput("X",
"The input tensor of softmax, " "The input tensor of softmax, "
"whose :attr:`axis` dimension is the input_feature_dimensions."); "whose dimension :attr:`axis` is the input_feature_dimensions.");
AddOutput("Out", "The normalized values with the same shape as X."); AddOutput("Out", "The normalized values with the same shape as X.");
AddAttr<int>("axis", AddAttr<int>("axis",
"The dimension index of Input(x) to perform softmax," "The dimension index of Input(x) to perform softmax,"
...@@ -116,13 +116,13 @@ Softmax Operator. ...@@ -116,13 +116,13 @@ Softmax Operator.
The input of the softmax operator is a tensor of any rank. The output tensor The input of the softmax operator is a tensor of any rank. The output tensor
has the same shape as the input. has the same shape as the input.
The :attr:`axis` th dimension of the input tensor will be permuted to the last. The dimension :attr:`axis` of the input tensor will be permuted to the last.
Then the input tensor will be logically flattened to a 2-D matrix. The matrix's Then the input tensor will be logically flattened to a 2-D matrix. The matrix's
second dimension(row length) is as same as the :attr:`axis` dimension of the input second dimension(row length) is as same as the dimension :attr:`axis` of the input
tensor, and the first dimension(column length) is the product of all other tensor, and the first dimension(column length) is the product of all other
dimensions of the input tensor. For each row of the matrix, the softmax operator dimensions of the input tensor. For each row of the matrix, the softmax operator
squashes the K-dimensional(K is the width of the matrix, which is also the size squashes the K-dimensional(K is the width of the matrix, which is also the size
of the input tensor's :attr:`axis` dimension) vector of arbitrary real values to a of the input tensor's dimension :attr:`axis`) vector of arbitrary real values to a
K-dimensional vector of real values in the range [0, 1] that add up to 1. K-dimensional vector of real values in the range [0, 1] that add up to 1.
It computes the exponential of the given dimension and the sum of exponential It computes the exponential of the given dimension and the sum of exponential
values of all the other dimensions in the K-dimensional vector input. values of all the other dimensions in the K-dimensional vector input.
......
...@@ -1824,13 +1824,13 @@ def softmax(input, use_cudnn=False, name=None, axis=-1): ...@@ -1824,13 +1824,13 @@ def softmax(input, use_cudnn=False, name=None, axis=-1):
The input of the softmax operator is a tensor of any rank. The output tensor The input of the softmax operator is a tensor of any rank. The output tensor
has the same shape as the input. has the same shape as the input.
The :attr:`axis` th dimension of the input tensor will be permuted to the last. The dimension :attr:`axis` of the input tensor will be permuted to the last.
Then the input tensor will be logically flattened to a 2-D matrix. The matrix's Then the input tensor will be logically flattened to a 2-D matrix. The matrix's
second dimension(row length) is as same as the :attr:`axis` th dimension of the input second dimension(row length) is as same as the dimension :attr:`axis` of the input
tensor, and the first dimension(column length) is the product of all other tensor, and the first dimension(column length) is the product of all other
dimensions of the input tensor. For each row of the matrix, the softmax operator dimensions of the input tensor. For each row of the matrix, the softmax operator
squashes the K-dimensional(K is the width of the matrix, which is also the size squashes the K-dimensional(K is the width of the matrix, which is also the size
of the input tensor's :attr:`axis` th dimension) vector of arbitrary real values to a of the input tensor's dimension :attr:`axis`) vector of arbitrary real values to a
K-dimensional vector of real values in the range [0, 1] that add up to 1. K-dimensional vector of real values in the range [0, 1] that add up to 1.
It computes the exponential of the given dimension and the sum of exponential It computes the exponential of the given dimension and the sum of exponential
...@@ -1852,7 +1852,9 @@ def softmax(input, use_cudnn=False, name=None, axis=-1): ...@@ -1852,7 +1852,9 @@ def softmax(input, use_cudnn=False, name=None, axis=-1):
False by default. Default: False False by default. Default: False
name (str|None): A name for this layer(optional). If set None, the layer name (str|None): A name for this layer(optional). If set None, the layer
will be named automatically. Default: None. will be named automatically. Default: None.
axis (int): The index of dimension to perform softmax calculation. Default: -1. axis (int): The index of dimension to perform softmax calculations, it should
be in range :math:`[-1, rank - 1]`, while :math:`rank` is the rank of
input variable. Default: -1.
Returns: Returns:
Variable: output of softmax Variable: output of softmax
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册