We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff62d22 commit 6f83aadCopy full SHA for 6f83aad
paddleseg/models/layers/activation.py
@@ -53,14 +53,15 @@ def __init__(self, act=None):
53
super(Activation, self).__init__()
54
55
self._act = act
56
- upper_act_names = nn.layer.activation.__all__
+ upper_act_names = nn.layer.activation.__dict__.keys()
57
lower_act_names = [act.lower() for act in upper_act_names]
58
act_dict = dict(zip(lower_act_names, upper_act_names))
59
60
if act is not None:
61
if act in act_dict.keys():
62
act_name = act_dict[act]
63
- self.act_func = eval("nn.layer.activation.{}()".format(act_name))
+ self.act_func = eval(
64
+ "nn.layer.activation.{}()".format(act_name))
65
else:
66
raise KeyError("{} does not exist in the current {}".format(
67
act, act_dict.keys()))
0 commit comments