未验证 提交 d389ddb5 编写于 作者: N Nyakku Shigure 提交者: GitHub

[CodeStyle][py2][U008] remove unnecessary args in `super()` for some example code (#47643)

* [CodeStyle][py2][U008] remove unnecessary args in `super()` for some example code

* empty commit, test=document_fix
上级 7bbdbe5b
...@@ -531,7 +531,7 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options): ...@@ -531,7 +531,7 @@ def spawn(func, args=(), nprocs=-1, join=True, daemon=False, **options):
class LinearNet(nn.Layer): class LinearNet(nn.Layer):
def __init__(self): def __init__(self):
super(LinearNet, self).__init__() super().__init__()
self._linear1 = nn.Linear(10, 10) self._linear1 = nn.Linear(10, 10)
self._linear2 = nn.Linear(10, 1) self._linear2 = nn.Linear(10, 1)
......
...@@ -1573,7 +1573,7 @@ class TracedLayer: ...@@ -1573,7 +1573,7 @@ class TracedLayer:
class ExampleLayer(paddle.nn.Layer): class ExampleLayer(paddle.nn.Layer):
def __init__(self): def __init__(self):
super(ExampleLayer, self).__init__() super().__init__()
self._fc = paddle.nn.Linear(3, 10) self._fc = paddle.nn.Linear(3, 10)
def forward(self, input): def forward(self, input):
...@@ -1591,7 +1591,7 @@ class TracedLayer: ...@@ -1591,7 +1591,7 @@ class TracedLayer:
print(out_static_graph[0].shape) # (2, 10) print(out_static_graph[0].shape) # (2, 10)
# save the static graph model for inference # save the static graph model for inference
static_layer.save_inference_model(dirname='./saved_infer_model') static_layer.save_inference_model('./saved_infer_model')
""" """
assert isinstance( assert isinstance(
...@@ -1623,7 +1623,7 @@ class TracedLayer: ...@@ -1623,7 +1623,7 @@ class TracedLayer:
class ExampleLayer(paddle.nn.Layer): class ExampleLayer(paddle.nn.Layer):
def __init__(self): def __init__(self):
super(ExampleLayer, self).__init__() super().__init__()
self._fc = paddle.nn.Linear(3, 10) self._fc = paddle.nn.Linear(3, 10)
def forward(self, input): def forward(self, input):
...@@ -1728,7 +1728,7 @@ class TracedLayer: ...@@ -1728,7 +1728,7 @@ class TracedLayer:
class ExampleLayer(paddle.nn.Layer): class ExampleLayer(paddle.nn.Layer):
def __init__(self): def __init__(self):
super(ExampleLayer, self).__init__() super().__init__()
self._fc = paddle.nn.Linear(3, 10) self._fc = paddle.nn.Linear(3, 10)
def forward(self, input): def forward(self, input):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册