Browse Source

add whitespace after comma

tags/v1.1.0
zhaozhenlong 5 years ago
parent
commit
60a28b4542
2 changed files with 6 additions and 6 deletions
  1. +1
    -1
      mindspore/nn/layer/basic.py
  2. +5
    -5
      mindspore/nn/layer/image.py

+ 1
- 1
mindspore/nn/layer/basic.py View File

@@ -530,7 +530,7 @@ class Pad(Cell):
>>> class Net(nn.Cell): >>> class Net(nn.Cell):
... def __init__(self): ... def __init__(self):
... super(Net, self).__init__() ... super(Net, self).__init__()
... self.pad = nn.Pad(paddings=((1,1),(2,2)), mode="CONSTANT")
... self.pad = nn.Pad(paddings=((1, 1), (2, 2)), mode="CONSTANT")
... def construct(self, x): ... def construct(self, x):
... return self.pad(x) ... return self.pad(x)
>>> x = np.random.random(size=(2, 3)).astype(np.float32) >>> x = np.random.random(size=(2, 3)).astype(np.float32)


+ 5
- 5
mindspore/nn/layer/image.py View File

@@ -55,7 +55,7 @@ class ImageGradients(Cell):


Examples: Examples:
>>> net = nn.ImageGradients() >>> net = nn.ImageGradients()
>>> image = Tensor(np.array([[[[1,2],[3,4]]]]), dtype=mindspore.int32)
>>> image = Tensor(np.array([[[[1, 2], [3, 4]]]]), dtype=mindspore.int32)
>>> output = net(image) >>> output = net(image)
>>> print(output) >>> print(output)
(Tensor(shape=[1, 1, 2, 2], dtype=Int32, value= (Tensor(shape=[1, 1, 2, 2], dtype=Int32, value=
@@ -219,8 +219,8 @@ class SSIM(Cell):


Examples: Examples:
>>> net = nn.SSIM() >>> net = nn.SSIM()
>>> img1 = Tensor(np.random.random((1,3,16,16)), mindspore.float32)
>>> img2 = Tensor(np.random.random((1,3,16,16)), mindspore.float32)
>>> img1 = Tensor(np.random.random((1, 3, 16, 16)), mindspore.float32)
>>> img2 = Tensor(np.random.random((1, 3, 16, 16)), mindspore.float32)
>>> output = net(img1, img2) >>> output = net(img1, img2)
>>> print(output) >>> print(output)
[0.12174469] [0.12174469]
@@ -394,8 +394,8 @@ class PSNR(Cell):


Examples: Examples:
>>> net = nn.PSNR() >>> net = nn.PSNR()
>>> img1 = Tensor(np.random.random((1,3,16,16)))
>>> img2 = Tensor(np.random.random((1,3,16,16)))
>>> img1 = Tensor(np.random.random((1, 3, 16, 16)))
>>> img2 = Tensor(np.random.random((1, 3, 16, 16)))
>>> output = net(img1, img2) >>> output = net(img1, img2)
>>> print(output) >>> print(output)
[7.7229595] [7.7229595]


Loading…
Cancel
Save