提交 7e81a9e6 编写于 作者: xuyang2233's avatar xuyang2233

modified annotation

上级 3e8f5ce4
# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
...@@ -20,11 +20,7 @@ from __future__ import absolute_import ...@@ -20,11 +20,7 @@ from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import paddle
from paddle import ParamAttr
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F
import numpy as np
__all__ = ["ResNet32"] __all__ = ["ResNet32"]
...@@ -51,10 +47,10 @@ class ResNet32(nn.Layer): ...@@ -51,10 +47,10 @@ class ResNet32(nn.Layer):
def forward(self, inputs): def forward(self, inputs):
""" """
Args: Args:
inputs (torch.Tensor): input feature inputs: input feature
Returns: Returns:
torch.Tensor: output feature output feature
""" """
return self.ConvNet(inputs) return self.ConvNet(inputs)
...@@ -92,7 +88,7 @@ class BasicBlock(nn.Layer): ...@@ -92,7 +88,7 @@ class BasicBlock(nn.Layer):
out_planes (int): channels of the middle feature out_planes (int): channels of the middle feature
stride (int): stride of the convolution stride (int): stride of the convolution
Returns: Returns:
nn.Module: Conv2D with kernel = 3 nn.Layer: Conv2D with kernel = 3
""" """
...@@ -102,14 +98,6 @@ class BasicBlock(nn.Layer): ...@@ -102,14 +98,6 @@ class BasicBlock(nn.Layer):
bias_attr=False) bias_attr=False)
def forward(self, x): def forward(self, x):
"""
Args:
x (torch.Tensor): input feature
Returns:
torch.Tensor: output feature of the BasicBlock
"""
residual = x residual = x
out = self.conv1(x) out = self.conv1(x)
...@@ -246,14 +234,6 @@ class ResNet(nn.Layer): ...@@ -246,14 +234,6 @@ class ResNet(nn.Layer):
return nn.Sequential(*layers) return nn.Sequential(*layers)
def forward(self, x): def forward(self, x):
"""
Args:
x (torch.Tensor): input feature
Returns:
torch.Tensor: output feature of the Resnet
"""
x = self.conv0_1(x) x = self.conv0_1(x)
x = self.bn0_1(x) x = self.bn0_1(x)
x = self.relu(x) x = self.relu(x)
......
...@@ -19,7 +19,6 @@ from __future__ import print_function ...@@ -19,7 +19,6 @@ from __future__ import print_function
import paddle import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
import numpy as np
class SPINAttentionHead(nn.Layer): class SPINAttentionHead(nn.Layer):
......
...@@ -21,7 +21,6 @@ import paddle ...@@ -21,7 +21,6 @@ import paddle
from paddle import nn, ParamAttr from paddle import nn, ParamAttr
from paddle.nn import functional as F from paddle.nn import functional as F
import numpy as np import numpy as np
import itertools
import functools import functools
from .tps import GridGenerator from .tps import GridGenerator
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册