未验证 提交 35ef4180 编写于 作者: L Li Min 提交者: GitHub

Fix typos in English docs for diag and diagflat. (#34869)

* Fix typos in english docs for diag and diagflat.
上级 b1cc4a46
...@@ -79,7 +79,7 @@ class DiagV2OpMaker : public framework::OpProtoAndCheckerMaker { ...@@ -79,7 +79,7 @@ class DiagV2OpMaker : public framework::OpProtoAndCheckerMaker {
"Tensor. The default value is 0.") "Tensor. The default value is 0.")
.SetDefault(0.0f); .SetDefault(0.0f);
AddComment(R"DOC( 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. If ``x`` is a matrix (2-D tensor), a 1-D tensor with the diagonal elements of ``x`` is returned.
......
...@@ -13342,7 +13342,7 @@ def shuffle_channel(x, group, name=None): ...@@ -13342,7 +13342,7 @@ def shuffle_channel(x, group, name=None):
[[0.7, 0.8], [[0.7, 0.8],
[0.8, 0.9]]]] [0.8, 0.9]]]]
Given group: 2 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.shape = (1, 4, 2, 2)
out.data = [[[[0.1, 0.2], out.data = [[[[0.1, 0.2],
[0.2, 0.3]], [0.2, 0.3]],
...@@ -13370,7 +13370,9 @@ def shuffle_channel(x, group, name=None): ...@@ -13370,7 +13370,9 @@ def shuffle_channel(x, group, name=None):
Examples: Examples:
.. code-block:: python .. 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') input = fluid.data(name='input', shape=[None,4,2,2], dtype='float32')
out = fluid.layers.shuffle_channel(x=input, group=2) out = fluid.layers.shuffle_channel(x=input, group=2)
""" """
......
...@@ -777,7 +777,7 @@ def meshgrid(*args, **kwargs): ...@@ -777,7 +777,7 @@ def meshgrid(*args, **kwargs):
def diagflat(x, offset=0, name=None): 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. 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): ...@@ -902,7 +902,7 @@ def diagflat(x, offset=0, name=None):
def diag(x, offset=0, padding_value=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. If ``x`` is a matrix (2-D tensor), a 1-D tensor with the diagonal elements of ``x`` is returned.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册