!20065 Fix the file format problem of the operator

Merge pull request !20065 from dinglinhe/code_docs_dlh_r1.3_I408LD
This commit is contained in:
i-robot 2021-07-12 08:36:47 +00:00 committed by Gitee
commit 672883b785
2 changed files with 27 additions and 27 deletions

View File

@ -760,7 +760,7 @@ class Pad(Cell):
... self.pad = nn.Pad(paddings=((1, 1), (2, 2)), mode="REFLECT")
... def construct(self, x):
... return self.pad(x)
>>> x = Tensor(np.array([[1, 2, 3], [4, 5, 6]]), mindsprore.float32)
>>> x = Tensor(np.array([[1, 2, 3], [4, 5, 6]]), mindspore.float32)
>>> pad = Net()
>>> output = pad(x)
>>> print(output)
@ -775,7 +775,7 @@ class Pad(Cell):
... self.pad = nn.Pad(paddings=((1, 1), (2, 2)), mode="SYMMETRIC")
... def construct(self, x):
... return self.pad(x)
>>> x = Tensor(np.array([[1, 2, 3], [4, 5, 6]]), mindsprore.float32)
>>> x = Tensor(np.array([[1, 2, 3], [4, 5, 6]]), mindspore.float32)
>>> pad = Net()
>>> output = pad(x)
>>> print(output)
@ -1007,9 +1007,9 @@ class Tril(Cell):
Examples:
>>> x = Tensor(np.array([[ 1, 2, 3, 4],
>>> [ 5, 6, 7, 8],
>>> [10, 11, 12, 13],
>>> [14, 15, 16, 17]]))
... [ 5, 6, 7, 8],
... [10, 11, 12, 13],
... [14, 15, 16, 17]]))
>>> tril = nn.Tril()
>>> result = tril(x)
>>> print(result)
@ -1018,9 +1018,9 @@ class Tril(Cell):
[10, 11, 12, 0],
[14, 15, 16, 17]]))
>>> x = Tensor(np.array([[ 1, 2, 3, 4],
>>> [ 5, 6, 7, 8],
>>> [10, 11, 12, 13],
>>> [14, 15, 16, 17]]))
... [ 5, 6, 7, 8],
... [10, 11, 12, 13],
... [14, 15, 16, 17]]))
>>> tril = nn.Tril()
>>> result = tril(x, 1)
>>> print(result)
@ -1029,9 +1029,9 @@ class Tril(Cell):
[10, 11, 12, 13],
[14, 15, 16, 17]]))
>>> x = Tensor(np.array([[ 1, 2, 3, 4],
>>> [ 5, 6, 7, 8],
>>> [10, 11, 12, 13],
>>> [14, 15, 16, 17]]))
... [ 5, 6, 7, 8],
... [10, 11, 12, 13],
... [14, 15, 16, 17]]))
>>> tril = nn.Tril()
>>> result = tril(x, 2)
>>> print(result)
@ -1040,9 +1040,9 @@ class Tril(Cell):
[10, 11, 12, 13],
[14, 15, 16, 17]]))
>>> x = Tensor(np.array([[ 1, 2, 3, 4],
>>> [ 5, 6, 7, 8],
>>> [10, 11, 12, 13],
>>> [14, 15, 16, 17]]))
... [ 5, 6, 7, 8],
... [10, 11, 12, 13],
... [14, 15, 16, 17]]))
>>> tril = nn.Tril()
>>> result = tril(x, -1)
>>> print(result)
@ -1094,9 +1094,9 @@ class Triu(Cell):
Examples:
>>> x = Tensor(np.array([[ 1, 2, 3, 4],
>>> [ 5, 6, 7, 8],
>>> [10, 11, 12, 13],
>>> [14, 15, 16, 17]]))
... [ 5, 6, 7, 8],
... [10, 11, 12, 13],
... [14, 15, 16, 17]]))
>>> triu = nn.Triu()
>>> result = triu(x)
>>> print(result)
@ -1105,9 +1105,9 @@ class Triu(Cell):
[ 0, 0, 12, 13],
[ 0, 0, 0, 17]]))
>>> x = Tensor(np.array([[ 1, 2, 3, 4],
>>> [ 5, 6, 7, 8],
>>> [10, 11, 12, 13],
>>> [14, 15, 16, 17]]))
... [ 5, 6, 7, 8],
... [10, 11, 12, 13],
... [14, 15, 16, 17]]))
>>> triu = nn.Triu()
>>> result = triu(x, 1)
>>> print(result)
@ -1116,9 +1116,9 @@ class Triu(Cell):
[ 0, 0, 0, 13],
[ 0, 0, 0, 0]]))
>>> x = Tensor(np.array([[ 1, 2, 3, 4],
>>> [ 5, 6, 7, 8],
>>> [10, 11, 12, 13],
>>> [14, 15, 16, 17]]))
... [ 5, 6, 7, 8],
... [10, 11, 12, 13],
... [14, 15, 16, 17]]))
>>> triu = nn.Triu()
>>> result = triu(x, 2)
>>> print(result)
@ -1127,9 +1127,9 @@ class Triu(Cell):
[ 0, 0, 0, 0],
[ 0, 0, 0, 0]]))
>>> x = Tensor(np.array([[ 1, 2, 3, 4],
>>> [ 5, 6, 7, 8],
>>> [10, 11, 12, 13],
>>> [14, 15, 16, 17]]))
... [ 5, 6, 7, 8],
... [10, 11, 12, 13],
... [14, 15, 16, 17]]))
>>> triu = nn.Triu()
>>> result = triu(x, -1)
>>> print(result)

View File

@ -259,7 +259,7 @@ class CellList(_CellListBase, Cell):
>>> cell_ls = nn.CellList([bn])
>>> cell_ls.insert(0, conv)
>>> cell_ls.append(relu)
>>> cell_ls
>>> print(cell_ls)
CellList<
(0): Conv2d<input_channels=100, output_channels=20, kernel_size=(3, 3),stride=(1, 1), pad_mode=same,
padding=0, dilation=(1, 1), group=1, has_bias=False, weight_init=normal, bias_init=zeros, format=NCHW>