diff --git a/paddle/fluid/operators/diag_v2_op.cc b/paddle/fluid/operators/diag_v2_op.cc index ae78517182a22a13cd0ef7bfb68ce7cab2c42087..dd5ad739506e0dc3abdeb46e1ff3e2ab7f87af93 100644 --- a/paddle/fluid/operators/diag_v2_op.cc +++ b/paddle/fluid/operators/diag_v2_op.cc @@ -79,7 +79,7 @@ class DiagV2OpMaker : public framework::OpProtoAndCheckerMaker { "Tensor. The default value is 0.") .SetDefault(0.0f); AddComment(R"DOC( - If ``x`` is a vector (1-D tensor), a 2-D square tensor whth the elements of ``x`` as the diagonal is returned. + If ``x`` is a vector (1-D tensor), a 2-D square tensor with the elements of ``x`` as the diagonal is returned. If ``x`` is a matrix (2-D tensor), a 1-D tensor with the diagonal elements of ``x`` is returned. diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 656f1efe493dea25b1bc3cff2abdb06077f9d0b5..6251bdf165a9740cc2f0eb28043f81ff151bb58e 100755 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -13342,7 +13342,7 @@ def shuffle_channel(x, group, name=None): [[0.7, 0.8], [0.8, 0.9]]]] Given group: 2 - then we get a 4-D tensor out whth the same shape of input: + then we get a 4-D tensor out with the same shape of input: out.shape = (1, 4, 2, 2) out.data = [[[[0.1, 0.2], [0.2, 0.3]], @@ -13370,7 +13370,9 @@ def shuffle_channel(x, group, name=None): Examples: .. code-block:: python - import paddle.fluid as fluid + import paddle + import paddle.fluid as fluid + paddle.enable_static() input = fluid.data(name='input', shape=[None,4,2,2], dtype='float32') out = fluid.layers.shuffle_channel(x=input, group=2) """ diff --git a/python/paddle/tensor/creation.py b/python/paddle/tensor/creation.py index 6354e8778795adf4b12cc67996a3075499c974c6..71968d67ed693c1f19efbaa3d272eae69dd31998 100644 --- a/python/paddle/tensor/creation.py +++ b/python/paddle/tensor/creation.py @@ -777,7 +777,7 @@ def meshgrid(*args, **kwargs): def diagflat(x, offset=0, name=None): """ - If ``x`` is a vector (1-D tensor), a 2-D square tensor whth the elements of ``x`` as the diagonal is returned. + If ``x`` is a vector (1-D tensor), a 2-D square tensor with the elements of ``x`` as the diagonal is returned. If ``x`` is a tensor (more than 1-D), a 2-D square tensor with the elements of flattened ``x`` as the diagonal is returned. @@ -902,7 +902,7 @@ def diagflat(x, offset=0, name=None): def diag(x, offset=0, padding_value=0, name=None): """ - If ``x`` is a vector (1-D tensor), a 2-D square tensor whth the elements of ``x`` as the diagonal is returned. + If ``x`` is a vector (1-D tensor), a 2-D square tensor with the elements of ``x`` as the diagonal is returned. If ``x`` is a matrix (2-D tensor), a 1-D tensor with the diagonal elements of ``x`` is returned.