提交 79144228 编写于 作者: 万万没想到

fix format typo in examples

上级 e364936b
......@@ -50,7 +50,7 @@ class ControlDepend(Primitive):
>>> # step should be increased, so the add operation should depend on the data calculation operation.
>>> class Net(nn.Cell):
>>> def __init__(self):
>>> super(Net, self).__init__()
>>> super(Net, self).__init__()
>>> self.global_step = mindspore.Parameter(initializer(0, [1]), name="global_step")
>>> self.rate = 0.2
>>> self.control_depend = P.ControlDepend()
......@@ -89,7 +89,7 @@ class GeSwitch(PrimitiveWithInfer):
Examples:
>>> class Net(nn.Cell):
>>> def __init__(self):
>>> super(Net, self).__init__()
>>> super(Net, self).__init__()
>>> self.square = P.Square()
>>> self.add = P.TensorAdd()
>>> self.value = Tensor(np.full((1), 3), mindspore.float32)
......
......@@ -39,7 +39,7 @@ class Assign(PrimitiveWithInfer):
>>> self.y = mindspore.Parameter(Tensor([1.0], mindspore.float32), name="y")
>>>
>>> def construct(self, x):
>>> Assign()(self.y, x)
>>> P.Assign()(self.y, x)
>>> return x
>>> x = Tensor([2.0], mindspore.float32)
>>> net = Net()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册