Skip to content

Commit 0329ee7

Browse files
authored
Merge pull request #11497 from tensor-tang/doc
Doc update
2 parents 5fd142c + 98ab2b4 commit 0329ee7

File tree

6 files changed

+33
-28
lines changed

6 files changed

+33
-28
lines changed

paddle/fluid/operators/activation_op.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,14 @@ class SoftShrinkOpMaker : public framework::OpProtoAndCheckerMaker {
252252
AddOutput("Out", "Output of Softshrink operator");
253253
AddAttr<float>("lambda", "non-negative offset").SetDefault(0.5f);
254254
AddComment(R"DOC(
255-
Softshrink Activation Operator.
256-
257-
$$
258-
out = \begin{cases}
259-
x - \lambda, \text{if } x > \lambda \\
260-
x + \lambda, \text{if } x < -\lambda \\
261-
0, \text{otherwise}
262-
\end{cases}
263-
$$
255+
:strong:`Softshrink Activation Operator`
256+
257+
.. math::
258+
out = \begin{cases}
259+
x - \lambda, \text{if } x > \lambda \\
260+
x + \lambda, \text{if } x < -\lambda \\
261+
0, \text{otherwise}
262+
\end{cases}
264263
265264
)DOC");
266265
}

paddle/fluid/operators/mean_op.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ class MeanOp : public framework::OperatorWithKernel {
3333
class MeanOpMaker : public framework::OpProtoAndCheckerMaker {
3434
public:
3535
void Make() override {
36-
AddInput("X", "The input of mean op");
37-
AddOutput("Out", "The output of mean op").Reuse("X");
36+
AddInput("X", "(Tensor) The input of mean op");
37+
AddOutput("Out", "(Tensor) The output of mean op").Reuse("X");
3838
AddComment(R"DOC(
39-
Mean Operator.
40-
41-
Out is a scalar which is the mean of all elements in X.
39+
Mean Operator calculates the mean of all elements in X.
4240
4341
)DOC");
4442
}

python/paddle/fluid/layers/control_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def lod_rank_table(x, level=0):
707707
.. code-block:: python
708708
709709
x = fluid.layers.data(name='x', shape=[10],
710-
dtype='float32', lod_level=1)
710+
dtype='float32', lod_level=1)
711711
out = layers.lod_rank_table(x=x, level=0)
712712
"""
713713
helper = LayerHelper("lod_rank_table", **locals())

python/paddle/fluid/layers/io.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ def __create_unshared_decorated_reader__(op_type, reader, attrs, name=None):
541541

542542

543543
def shuffle(reader, buffer_size):
544+
"""
545+
Shuffle the reader.
546+
"""
544547
return __create_unshared_decorated_reader__(
545548
'create_shuffle_reader', reader, {'buffer_size': int(buffer_size)})
546549

python/paddle/fluid/layers/nn.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,11 @@ def embedding(input,
225225
have two elements which indicate the size of the dictionary of
226226
embeddings and the size of each embedding vector respectively.
227227
is_sparse(bool): The flag indicating whether to use sparse update.
228-
is_distributed (bool): Whether to run lookup table from remote parameter server.
228+
is_distributed(bool): Whether to run lookup table from remote parameter server.
229229
padding_idx(int|long|None): If :attr:`None`, it makes no effect to lookup.
230230
Otherwise the given :attr:`padding_idx` indicates padding the output
231231
with zeros whenever lookup encounters it in :attr:`input`. If
232-
:math:`padding_idx < 0`, the padding_idx to use in lookup is
232+
:math:`padding_idx < 0`, the :attr:`padding_idx` to use in lookup is
233233
:math:`size[0] + dim`.
234234
param_attr(ParamAttr): Parameters for this layer
235235
dtype(np.dtype|core.VarDesc.VarType|str): The type of data : float32, float_16, int etc
@@ -1235,14 +1235,17 @@ def conv2d(input,
12351235
act=None,
12361236
name=None):
12371237
"""
1238-
**Convlution2D Layer**
1239-
12401238
The convolution2D layer calculates the output based on the input, filter
1241-
and strides, paddings, dilations, groups parameters. Input(Input) and
1242-
Output(Output) are in NCHW format. Where N is batch size, C is the number of
1239+
and strides, paddings, dilations, groups parameters. Input and
1240+
Output are in NCHW format, where N is batch size, C is the number of
12431241
channels, H is the height of the feature, and W is the width of the feature.
1244-
The details of convolution layer, please refer UFLDL's `convolution,
1245-
<http://ufldl.stanford.edu/tutorial/supervised/FeatureExtractionUsingConvolution/>`_ .
1242+
Filter is in MCHW format, where M is the number of output image channels,
1243+
C is the number of input image channels, H is the height of the filter,
1244+
and W is the width of the filter. If the groups is greater than 1,
1245+
C will equal the number of input image channels divided by the groups.
1246+
Please refer to UFLDL's `convolution
1247+
<http://ufldl.stanford.edu/tutorial/supervised/FeatureExtractionUsingConvolution/>`_
1248+
for more detials.
12461249
If bias attribution and activation type are provided, bias is added to the
12471250
output of the convolution, and the corresponding activation function is
12481251
applied to the final result.
@@ -1253,15 +1256,14 @@ def conv2d(input,
12531256
12541257
Out = \sigma (W \\ast X + b)
12551258
1256-
In the above equation:
1259+
Where:
12571260
12581261
* :math:`X`: Input value, a tensor with NCHW format.
12591262
* :math:`W`: Filter value, a tensor with MCHW format.
12601263
* :math:`\\ast`: Convolution operation.
12611264
* :math:`b`: Bias value, a 2-D tensor with shape [M, 1].
12621265
* :math:`\\sigma`: Activation function.
1263-
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be
1264-
different.
1266+
* :math:`Out`: Output value, the shape of :math:`Out` and :math:`X` may be different.
12651267
12661268
Example:
12671269
@@ -1272,6 +1274,7 @@ def conv2d(input,
12721274
Filter shape: :math:`(C_{out}, C_{in}, H_f, W_f)`
12731275
12741276
- Output:
1277+
12751278
Output shape: :math:`(N, C_{out}, H_{out}, W_{out})`
12761279
12771280
Where
@@ -1283,7 +1286,7 @@ def conv2d(input,
12831286
12841287
Args:
12851288
input (Variable): The input image with [N, C, H, W] format.
1286-
num_filters(int): The number of filter. It is as same as the output
1289+
num_filters(int): The number of filter. It is as same as the output
12871290
image channel.
12881291
filter_size (int|tuple|None): The filter size. If filter_size is a tuple,
12891292
it must contain two integers, (filter_size_H, filter_size_W).
@@ -1306,7 +1309,8 @@ def conv2d(input,
13061309
bias_attr (ParamAttr): Bias parameter for the Conv2d layer. Default: None
13071310
use_cudnn (bool): Use cudnn kernel or not, it is valid only when the cudnn
13081311
library is installed. Default: True
1309-
use_mkldnn (bool): Use mkldnn kernels or not.
1312+
use_mkldnn (bool): Use mkldnn kernels or not, it is valid only when compiled
1313+
with mkldnn library. Default: False
13101314
act (str): Activation type. Default: None
13111315
name (str|None): A name for this layer(optional). If set None, the layer
13121316
will be named automatically.

python/paddle/fluid/layers/tensor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ def assign(input, output):
201201
202202
Examples:
203203
.. code-block:: python
204+
204205
out = fluid.layers.create_tensor(dtype='float32')
205206
hidden = fluid.layers.fc(input=data, size=10)
206207
fluid.layers.assign(hidden, out)

0 commit comments

Comments
 (0)