@@ -3380,6 +3380,7 @@ def reshape(x, shape, actual_shape=None, act=None, inplace=True, name=None):
3380
3380
3381
3381
Examples:
3382
3382
.. code-block:: python
3383
+
3383
3384
data = fluid.layers.data(
3384
3385
name='data', shape=[2, 4, 6], dtype='float32')
3385
3386
reshaped = fluid.layers.reshape(
@@ -3585,12 +3586,13 @@ def lrn(input, n=5, k=1.0, alpha=1e-4, beta=0.75, name=None):
3585
3586
3586
3587
def pad (x , paddings , pad_value = 0. , name = None ):
3587
3588
"""
3588
- Pads a tensor with a constant value given by :attr:pad_value, and the
3589
- padded width is specified by :attr:paddings.
3589
+ Pads a tensor with a constant value given by :attr:` pad_value` , and the
3590
+ padded width is specified by :attr:` paddings` .
3590
3591
3591
- Specifically, the number of values padded before each dimension
3592
- :attr:i is indicated by :attr:paddings[i], and the number of values padded
3593
- after each dimension :attr:i is indicated by :attr:paddings[i+1].
3592
+ Specifically, the number of values padded before the contents of :attr:`x`
3593
+ in dimension :attr:`i` is indicated by :attr:`paddings[i]`, and the number
3594
+ of values padded after the contents of :attr:`x` in dimension :attr:`i` is
3595
+ indicated by :attr:`paddings[i+1]`.
3594
3596
3595
3597
See below for an example.
3596
3598
@@ -3624,6 +3626,7 @@ def pad(x, paddings, pad_value=0., name=None):
3624
3626
3625
3627
Examples:
3626
3628
.. code-block:: python
3629
+
3627
3630
# x is a rank 2 tensor variable.
3628
3631
out = fluid.layers.pad(
3629
3632
x=x, paddings=[0, 1, 1, 2], pad_value=0.)
0 commit comments