From 17584dc205971c439a192a77741f9612092b8975 Mon Sep 17 00:00:00 2001 From: Wei-Chih Tu Date: Thu, 4 Apr 2019 15:24:27 +0800 Subject: [PATCH] line 40: Explicitly cast to int --- test/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/network.py b/test/network.py index 1029b2e..7ff929e 100644 --- a/test/network.py +++ b/test/network.py @@ -37,7 +37,7 @@ def forward(self, x): class PixelAffinityNet(nn.Module): def __init__(self, nr_channel, conv1_size, use_canny=True): super(PixelAffinityNet, self).__init__() - pad_size = (conv1_size - 1) / 2 + pad_size = int((conv1_size - 1) / 2) self.pad1 = nn.ReplicationPad2d((pad_size, pad_size, 0, 0)) # left, right, top, bottom self.conv1 = nn.Conv2d(3, nr_channel, kernel_size=(1, conv1_size), stride=1, padding=0, bias=True) self.in1 = nn.InstanceNorm2d(nr_channel, affine=False, track_running_stats=True)