summaryrefslogtreecommitdiff
path: root/models/fpfe.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2020-12-23 21:06:56 +0800
committerJordan Gong <jordan.gong@protonmail.com>2020-12-23 21:07:44 +0800
commitdedf51f4fcbfb954558e157a0e449fc2ea48e7e1 (patch)
tree4e1a9b3998e758a2f479a134ac0aae7fe1d955a7 /models/fpfe.py
parent382912b087af409cc20628c711261c6bd3f99836 (diff)
Make activation inplace
Diffstat (limited to 'models/fpfe.py')
-rw-r--r--models/fpfe.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/models/fpfe.py b/models/fpfe.py
index 4a5cde8..7d04655 100644
--- a/models/fpfe.py
+++ b/models/fpfe.py
@@ -25,13 +25,13 @@ class FrameLevelPartFeatureExtractor(nn.Module):
self.max_pool = nn.MaxPool2d(kernel_size=2, stride=2)
def forward(self, x):
- x = F.leaky_relu(self.focal_conv1(x))
- x = F.leaky_relu(self.focal_conv2(x))
+ x = F.leaky_relu(self.focal_conv1(x), inplace=True)
+ x = F.leaky_relu(self.focal_conv2(x), inplace=True)
x = self.max_pool(x)
- x = F.leaky_relu(self.focal_conv3(x))
- x = F.leaky_relu(self.focal_conv4(x))
+ x = F.leaky_relu(self.focal_conv3(x), inplace=True)
+ x = F.leaky_relu(self.focal_conv4(x), inplace=True)
x = self.max_pool(x)
- x = F.leaky_relu(self.focal_conv5(x))
- x = F.leaky_relu(self.focal_conv6(x))
+ x = F.leaky_relu(self.focal_conv5(x), inplace=True)
+ x = F.leaky_relu(self.focal_conv6(x), inplace=True)
- return x \ No newline at end of file
+ return x